Peter G Neumann, moderator of the ACM Risks forum, said this.
[Bug? Well, more like the 20-year window that was used in 2002 rolled
over. That's not a bug, it's a standard temporary fix that expired. PGN]
That's very true, and it is an underlying cause of so many of these date-related bugs. Developers, and sometimes the Requirements, can not envision the software they write being used so far into the future.
I normally hate regulation, but in this case an idea comes to mind. Software that handles dates should come with an expiration date set up front. Then require that it must be replace before the expiration date. (Windows 7 and Windows 98 users will scream.

)
I'm personally guilty of a "bug" caused by expiration. I wrote graphics programs for ASEA in Sweden. Projects there were fond of using 3 digit week numbers in project planning. Last digit of the year, plus week number within the year. So 1/9/2022 would be week 202. (Or maybe week 152 or 203 because New Years Day may be in the last week of the previous year, or the first week of the new year.) I tried and failed to find the algorithm used for that New Years Day handling. Those were pre-Internet days.
In desperation, I found printed calendars showing week number up to 5 years in the future. So I programmed those dates in, and put a note in
BOLD text in the manual that the week number function would expire after 5 years. When the 5 years expired, the users finally looked at the manual and they were very angry at me.