I made such a mistake over 3 years ago. Only found about it 2 years ago. Mostly, I was acting on insufficient information, and a bit of intuition. I identified the kind of error I made, noted what I had to do to avoid a repeat —which never happened since. I fixed then admitted the mistake, a couple days after finding it. It's standard procedure. I could have swept it under the rug, though I never considered it.
There wasn't much drama then. Just some mockery I wasn't even aware of (I didn't follow Twitter). I learned of it one year later, when some institution "awarded" the worst mistakes (they wrote pretty funny piece).
> Yes, there may be some drama, in the short term.
It was the only mistake of any consequence I've made in over 4 years working in this domain. Yet some people still use that one error to publicly question my competence and my ethics. As if they didn't realise the perverse incentives that results from punishing honest disclosure.