I've spent much of my career dealing with systems on many levels in the embedded world. UNIX m/f talking to PC's talking to strings of embedded controllers, etc.
Recently, I was downvoted (
appending is not done) for saying that something as mundane as a munged (minged? ;)) #! line might make otherwise sane code do something stupid. I thought I'd explain my rationale and the experience that led me to it. I agree that my suggestion was unlikely, and I did so qualify it, but it's not impossible.
Today's computer systems consist of many layers of software sitting on top of many layers of firmware and hardware logic. Further, this software has often been subjected to upgrading processes, none of which are ever guaranteed to have been complete or completed without error. There are often multiple variants of libraries resident on systems, and they are often all required by something or another. The legendary Linux kernel and (g)libc snafus come to mind here, but the problem is far more widespread than that. At work here (Sandia Labs), we have production systems running old code that we can't afford to take offline, and some of them still have non-Solaris SunOS. Who's to say what Perls are installed there, and where they are? More importantly, who's going to know what bugs are still buried in their kernels from waaay back then?
I've seen enough strangeness happening (even without considering inimical code from evil empires like M$) not to discount any possibility. 90% of all electronics-related problems are caused by cables and connectors, but, of the rest, more are due to mistaken assumptions than bugs.