I sometimes punish myself
Why do you need to punish yourself?
I set myself up for failure and then I fail. Woops!
I think that you should cut yourself some slack. You do not need to punish yourself everytime that you fail at something!
But, it does make me feel better about things.
Don't you think it just makes you feel better temporarily and probably not long term? You might be happier in the end if you find a better way to deal with your failures.