A crucial class writes files to a certain folder. The test sandbox provides such a folder, and the class knows to use that folder when it's running in test mode. Obviously, the production environment is also supposed to provide that folder. But oops, it doesn't!
The tests exercised writing a file to disk, the tests were all green, and the system crashed anyway.
Magic.
I'm not saying tests are evil, I actually love my test suites. But as always; as soon as someone uses ALWAYS and/or NEVER, those tiny hairs in the back of my neck do a sort of wave and I try to ignore their message, which is a shame since (in this saga) both Uncle Bob and Nephew David have good advice to offer.
As for immutability; add in referential transparency, static ish typing and you've got yourself a nice development setup ;)
Unit tests are at the heart of the test gauntlet, but absolutely can't be trusted by themselves.