It's called integrity. Regrettably it appears to be increasingly rare - particularly in the "climate science" and medical fields lately.
I've been there, done that. About 5 years ago I made one of the larger blunders of my nearly 4 decade career. I owned up to it immediately upon discovery, we fixed it, and moved on. We laugh about it now because though mortifying (to me anyway) at the time it is in retrospect a funny-as-h**l story.
That’ the way it’s supposed to be. No one is perfect. Mistakes will be made. Progress comes through acknowledging the mistakes and moving on.