I am familiar with this phrase and occasionally use it. It means someone who is caught in a trap of his own making or advocacy. For example, a politician who campaigns on honesty in government is found to be receiving kickbacks, or a preacher frequently pontificating on sexual morality is discovered with a stash of child pornography on his computer. The discovery and its consequence are an important part of the meaning. Just receiving the kickbacks and having the child pornography are not enough. I was taught the phrase by a former co-worker who was into military history, and it stuck with me all these years.
(Sometimes the phrase is stated “hoist on his own petard.” It’s your choice of preposition. Both are used the same, but “by” makes more sense.)
A petard is a small bomb once carried on the backs of French sappers and planted under castle walls. It had a long fuse to allow the sapper time to escape, but sometimes it went off unexpectedly, and the sapper was hoist (blown up) by his own petard.
The phrase is more memorable if it is taken one step further, I kid you not. The small petard bomb was named for the French word for fart. Hence, the phrase could literally mean someone affected by his own . . . well, Gentle Reader, I am sure you get the idea.
(This posting is filled with grammatical traps. I can only hope I got most of them correct. I will accept any criticism as constructive.)