Salaam,
Allah works in mysterious ways. He has outlined his rewards structure, the basics, the caveats and we hear of sunnahs about the rewards and atonements etc.
What you get is what you get, good or bad. There are 4 basic configurations, you work, you get; you work you don't get; you don't work, you get; you don't work, you don't get. So what was your intention? if you did it because Allah asks of you to earn an honest living, then you are blessed whatever happens, and forgiveness given whatever the outcome and as a result, you also get to benefit in the hereafter. If you did it for worldly purposes only, then you get neither blessings nor forgiveness for those same endeavors. So if the reward is success, you will enjoy your worldly gains and non for the hereafter.
As a saying goes (I read it somewhere in this forum) about a man who was 'martyred' but will be hell-bound because he wanted recognition from the people. His intention was for the 'glory' rather than for Allah. The act is the same, but the intention is waaaayyy off! It's so easy to be vain, which leads to pride (the root cause for Iblis' downfall).
But, if on the off-chance, you fall in the category of
don't work, you get, don't forget to praise Him, be thankful, give zakat, be charitable. That would surely please Allah, gain you extra points for the hereafter and who knows, you get an extension of good fortune

and to also be thankful in the event of failure, this is
the tough one! Plodding on and not be bitter (also earning points).
These are just my thoughts on the matter. Bottom-line is, only Allah knows the realms of this topic. The flesh-bound mind of humans just cannot grasp the magnitude of Allah's mercy.
Peace:shade: