It sounds like perfectionism. I recently got a book on it to help me with my own, but it was CBT-heavy which I find blamey and unhelpful, so I returned it because it wasn't perfect, haha. Right after that, I found a book called Imperfectionism that helped me make a huge shift in some of my thinking just reading the first two or three chapters. The last chapter I read was on rumination! The author is a layperson and his writing style is a bit hyper, like he really wants to convince the reader about his method I haven't even gotten to, but I'm really satisfied just having read the first part.
To answer your question in the title, I don't go down like you do for one small mistake, but I can relate to it. If I don't do something perfectly that was emotionally significant, my norm has been to pick out the one minor error in the entire effort, ruminate, and beat myself up and catastrophize. It's like there's a big giant maginfying glass that focuses on that one little thing and blows it up really big, bigger than me, and there's an accompanying message that it's focusing on me and I'm an awful person or I've done tremendous, irreversible harm. I'm learning to simmer that way down.
Sending empathy and compassion!