Excellent point. A bad outcome realized through a correct decision making process is painful, but is still a "better" result than a good outcome realized through a flawed decision making process. When poker players go "on tilt" they start breaking their process and it shows in their long run results.
There are few places where this is more on display than in high stakes poker tournaments.
Why not work to achieve things of value precisely because they are of value to you?
If you are fixated on the goal, rather than being present performing the actions that will get you to the goal, you are actually less likely to reach the goal successfully. Thinking about the goal obsessively is counterproductive.
Maybe "detach from the outcome" is a better word. Anchor your happiness and well-being on performing the actions within your control that you believe will take you to that outcome, and do not make that happiness and well-being conditional on reaching that outcome.