This is what happens when people who are programming as a second (or third) choice are responsible for essential code. They do not have the mindset to think the way code executes.
And, of course, nobody tests anymore....
Failure to test is one of the biggest contributors to the ongoing backsliding in IT. We have programs roll out to today that clearly show that no one wanted to spend the time nor money on simple tests.
I regularly witness failures for routine things that were resolved two decades ago that anyone with basic skills could prevent.
Of course they do. After all, if it works on their machine it must be OK, right? /s
TIP. Test In Production.