It happened just some days ago.
To hide some potentially dangerous properties and restrict access in the browser I used a closure function. Pretty boring stuff. I committed everything, created a PR, and on getting my stuff merged into master and automatically deployed my phone rings. Someone of the Sales department called me and argued about some weird stuff happened, and he lost some data.
It sounded impossible to be true. All test cases passed successfully. The guy who did the code review accepted my changes. How on earth is it possible that my last code changes cause data lose?
I debugged, I struggled, I called for an additional pair of eyes. We found nothing.
I called our database teams to restore some data sets, and they told me nothing to restore, it's all still there. I was surprised. I called the Sales guy and convinced him that everything is okay. We try to fix the 'view' problem early tomorrow morning.
I went home and when I parked my car I had a thought:
What if, I just enclosed the data?
I called to a colleague in Mexico (glad we have 9 hours difference between Germany and Mexico), maybe he can fix my stuff. Some minutes later he called me back by phone and laughed at me because I forgot to return the correct value. Instead, I returned false because that was the initial return value to fulfill the interface rules defined by the test cases. To my surprise, the tests didn't detect the issue due some typo in the test suite. The guy before me wrote all the tests my code had to pass. But two of the tests never run in the test suite. I executed them manually not by running the entire test suite.
Shit happens. I sweated blood and water because losing financial data is a problem for the J-SOX and SOX auditors. Lucky me, fixing the issue was just as easy as count from one to three.