Prevent date input after certain value – revert to last date or leave the "wrong" date

I'm working on a date input field that should restrict the user from writing a date that comes after a certain date - to exemplify it: the user should not choose a date after 15.03.2020. This date would be the placeholder date that is in the input field, and the user can choose a date before 15.03.2020, but not after

There are two ways to choose a date - either to input it on the keyboard, or to pick it from a date-picker.

  1. If the user chooses the date picker, date-picker restricts choosing a date after 05.05.2023, by disabling these in the date-picker control, indicating that the option to pick those exact dates does not exist. date-picker with restricted date range

  2. But if the user wants to use the keyboard, should a validation error be shown and let user change the date herself, or do we revert to the last eligible date? In that case user tries to input 16/03/2021, but is warned and automatically date reverts to the 15/03/2021 when the user switches focus to another field. input with validation error

To sum it up, I am struggling with this "automatically reverting" to the last (or first) eligible date - would the users notice it, would it be difficult to understand why they cannot input a date they wanted in the first place. Or would they find it troublesome to have to correct the date themselves back.