Maybe a terrorist may find a way to become an air marshal.
Maybe an air marshal on a flight may go insane and decide to start shooting.
Plenty of undesirable possibilities not to mention accidental shooting holes in the aircraft in the event of a problem. I don't see this as a good solution to the security issue.