Yeah, the safety switches are sometimes a pain, but, they are there for just that, our safety. Do not bypass them.
The solenoid on the bottom of the carb is the anti-backfire solenoid. It has a plunger which is energized when the key is turned to the "on" position and pulls away from the main jet allowing gas to flow into and through the main jet. When the key is turned off, the plunger, spring loaded, closes off the main jet which will prevent a backfire, supposedly.
I picked u a mower yesterday due to a burned out solenoid, same thing. I will replace it because it is not my mower. But, I cut the plunger off my mower about 2-3 years ago...... has not backfired yet..... and if and when it does, yee-haw. Just food for thought........