In the case of the coworker it seems like you could have documented each of these specific cases and confronted the person about it. How do you talk your way out of losing data repeatedly?
I've had exactly one boss who understood (some) of what I do.
Managing others, I've been completely snowed by people who's work is outside of my areas of expertise (tech writing, translation, graphic design, etc).
You needed code reviews and design documents. If your group was too busy for this, then it needed this "hero" to keep pushing code out the door instead of dwelling on design choices.