Guns opening on firing is a rare thing. Safeties being set on recoil is more common in my experience. Inertia is a powerful force. A good design takes it into account and deals with the mass of internal parts and their behavior under inertia.