Unfortunately, even when you work tirelessly at achieving a specific outcome, it is entirely possible that that outcome will not be what you intended. That is just how life works sometimes.
This is in no way an excuse to drop the ball, but rather a prompt to remember that even if you encounter failure, it is not a failure so long as you applied your talents and skills at maximum capacity. Sure, you cannot confuse efforts with results, but you are still responsible for your efforts, and each of us will be held accountable for those efforts. We are not always responsible for the outcome when the outcome is out of our control, but regardless, we are always responsible for the effort.
Be forgiving towards yourself when the results may not be what you expected, but only if you gave 200% of yourself to the project. There is never an excuse for laziness.