Your art teacher might speak of happy mistakes, moves that you thought might work but did not, or perhaps inadvertent literally mistaken scribbles or slashes of color. The question is what you do with what you have made. Some of the time, you get out your eraser or palette knife and clear off the surface. But some of the time, you see possibilities you had not imagined and you go in that direction, perhaps for good results, perhaps not.
Now, it might be that there was an earthquake, or someone passed by and hit your hand, or the materials were not well formulated and did peculiar things. So the mistakes may not be of your doing, but you are nonetheless presented with an unanticipated possibility.
You may not get the job your want (and they have hired the chair's brother), or promotion or tenure are denied--maybe unfairly, or it proves difficult to get your work published and so its difficult to maintain your position. You are doing unrecognizable work, or work that makes people uncomfortable. Or perhaps your work is no good, your personality is discomforting, your methodology is not what is conventionally done.
Namely, you may have made a mistake, others may have pushed you into it, you lose out in a distant battle where you are collateral damages, or perhaps you are not good enough.
There is much to be said for revenge, litigation, starting over, etc. But not enough to make me think that you should spend much energy on what has happened. What you have to do is to figure out how to make the mistakes happier, and in part this is making custard out of spilled milk, or some such.
Can you find an environment where what you do is what they want? Can you finally pursue your dream of becoming a lawyer, after years of doing mathematics? Can you give up the priesthood for a married life? Perhaps there is something you do not know that you would love, now made possible by your being kicked out of the nest.
It's disruptive and disturbing, and it is costly and likely emotionally draining. But it may be that the mistake is the avenue to a more productive and better life. It's no fun to say that you did not get tenure at Snooty University, but perhaps at Less-Snooty you pursue your interest in idiosyncratic idiocies and are able to develop a theory that takes your mistake and makes it into a subject.
You may have to give up dreams you did not know you had, to have dreams that you might actually fulfil.
And living well is surely the best revenge. Be gracious and generous to those who have destroyed your life. Be enthusiastic about your new life. No need to rub it in their faces, when in January they are freezing and you are sunning. Or the other way around. If you end up at a foundation giving out grants, you might want to spite them, but it is better to have them on your leash.
You may not succeed as you might have. And the loss might be quite substantial. But you may also find new sources of strength and achievement.
And perhaps there is no compensation. But at least you are not in the orbit of the death stars.