That is exactly the sort of terrifying scenario that lockout/tagout is meant to prevent. Lockout/tagout is a procedure to disable equipment to protect workers from either an unexpected release of energy or an accidental start-up while performing job activities.
When the Occupational Safety and Health Administration (OSHA) revealed the 10 most-violated OSHA standards, based on citations issued from Oct. 1, 2004, through Aug. 30, 2005, the fifth most-cited standard was lockout/tagout.