British idioms: Hoist by one’s own petard
This is a saying that has been appearing in the UK news lately because the leader of the opposition Labour Party is now being investigated for his own social meetings which broke the COVID lockdown rules, after calling on the Prime Minister to resign because he has been fined for one occasion of such an event at Downing Street and is still under investigation for others.
The phrase's meaning is to be accused of a crime that a person is accusing another of committing. it describes someone who has been scuppered by their own schemes, someone who has come a-cropper because of some mischief they intended against others. Another way of looking at it is to think of the schemer being defeated by their own scheme being used against them.
The origins are interesting. Literally speaking, it is when a bomb-maker is lifted ("hoisted") off the ground with his own bomb (a "petard" is a small explosive device), and indicates an ironic reversal.
William Shakespeare gets the credit for the first literary mention linking petards and hoisting, in 1604's edition of “Hamlet.” When Hamlet realizes that his uncle has ordered two vassals (Rosencrantz and Guildenstern) to kill him, he pledges instead to turn the tables:
For ’tis the sport to have the enginer
Hoist with his own petard; and ’t shall go hard
But I will delve one yard below their mines
And blow them at the moon. O, ’tis most sweet
When in one line two crafts directly meet.