The hazard switch is actually not that well secure/located/fixed.
At my last MOT the tester (who I know well over the years) apologised as he gently punched, as opposed to gently press, the hazard switch which then receded into the abyss. No harm done, the switch clicked back in and now both of us are wiser to the fragility/sensitivity of this particular component.
From and engineering point of view certain buttons/pedals/etc. in a car can expect forceful abuse in emergency situations (like hazard light switches) so they should be engineered to support expected forceful us.