I've approached this by taking the stance that life should be process-oriented, not results-oriented. Sometimes you can do the right thing and still lose. Sometimes you can do the wrong thing and win. "Success" is often just luck with a nice backstory written after the fact. That isn't to downplay anyone's hard work, but often it's luck that provides the opportunity to work hard for something worthwhile in the first place.
It's entirely possible that in your life, you could have succeeded and still ended up becoming poor due to circumstances beyond your control. It's also possible that if you had ultimately failed, circumstances would not have turned out the way it so obviously looked like they had to play out.
Ultimately, you can only control yourself in this universe. If you've done everything you could do and gave it your best, really did all you can, then regardless of the outcome, you should be proud of yourself.