This is a great example of validation-vs-correction: one of our policies in our engineering UIs is that inputs only allow valid data in the first place, which removes a lot of logic and sources of error
No UI choice I have ever seen is as user-hostile as this interaction.