Consider Chaos Theory, and its popular butterfly effect. If a butterfly flapping its wings was the final catalyst for the storm, is it rational to blame the butterfly? No. Even if we assume exceedingly intelligent butterflies, it has no way of knowing that its specific flight pattern could cause a storm.
Consider there is a scientist that develops a particularly dangerous new type of weapon. Despite taking all the normal security precautions and a few extra just to be safe, a very skilled thief breaks in, steals the weapon, and uses it to kill a great multitude of people. Who gets the murder charges, the scientist or the thief? Obviously the thief. The thief set out with intention to kill people, while the scientist was doing his due part to try to keep people away from his dangerous creation.
Now an example to suit our situation. Consider a pilot trying to land a plane. Everything seems normal, and he doesn't get any warning signals or anything. Yet when he lands on the runway, the plane hits the ground and get severely damaged, killing many of the passengers, but the pilot escapes. It would appear that though no alarms went off, the landing gear didn't deploy properly. Further investigation shows that an engineer intentionally disabled the landing gear in such a way that the alarms wouldn't go off. Who gets the jail time? The pilot who didn't successfully land the plane, or the engineer who sabotaged the plane? Once again, it should be obvious that it is the engineer.
The pilot is our button-presser, the plane is a train, the landing gear is safety protocols to make sure it doesn't hit anyone, and the engineer is monoowl.
Further, your example only works if the gun the person was holding looks suspiciously like a kazoo, rather than a gun. The person has used it before and it functioned like you would expect a kazoo to function. This one time, in addition to functioning like a kazoo, it also functioned like a gun. Now it is a rough parallel to our train problem. Do we blame the person who thought they were playing the kazoo, or the person who added the gun functionality to the kazoo, unbeknownst to the kazoo player? As always, the answer is obvious.