If you indeed think it’s gramatically incorrect, why don’t you correct it?
-- Shakespeare, Hamlet III iv.
"Hoist" was in Shakespeare's time the past participle of a verb "to hoise", which meant what "to hoist" does now: to lift. A petard (see under "peter out" for the etymology) was an explosive charge detonated by a slowly burning fuse. If the petard went off prematurely, then the sapper (military engineer; Shakespeare's "enginer") who planted it would be hurled into the air by the explosion. (Compare "up" in "to blow up".) A modern rendition might be: "It's fun to see the engineer blown up with his own bomb."