Let's start by naming what's happening. You're having intrusive thoughts about a mistake you made at work. These intrusive thoughts often show up in response to a trigger that takes us back to the painful memory. As a result of "re-remembering" we find ourselves experiencing a flood of emotions, akin to the day we made the mistake.
The way we respond to this flood of emotions is by "doing". We either try to overwork ourselves, bend our boundaries a little bit more to appease our bosses, start googling how bad the mistake you made was, play out every scenario possible where you make the mistake again, begin to doubt yourself and your competence, question if this profession is the right profession for you, play out alternatives to what happened when you made the mistake, and more. When we have intrusive thoughts, we feel inclined to attach meaning to them. If I have a thought, it must be true, and if it's true then what does that mean for me.
A good place to start is by recognizing that mistakes don't make a person. Secondly, thoughts are not always based in truth. Third, we don't have to do something about every single thought that pops up, what if we just chose to be with our thoughts? to sense the emotions that show up with our thoughts? to see our thoughts as we do our physical sensations - as being temporal and fleeting? The imp of the mind tells us that the more energy we expend on a thought, the larger and more dominating the thought becomes. What this means for us is, don't fight your thoughts, don't banish them, don't demonize them. Just be with them, notice them without judgement, recognize that they are not a threat, but just a fleeting mental event. A mental event that will pass only if you allow it to.