the joke's on sb

the joke's on (one)

1. One is experiencing or will experience a negative outcome, particularly one that was intended for someone else. The phrase typically refers to a practical joke or malicious act that has backfired. Greg set up this bucket of water to fall on me, but the joke's on him now—I rigged it up over his bedroom door. He thought he could steal my job by telling the boss terrible things about me, but the joke's on him—he's getting fired for misuse of company time.
2. One seems silly or foolish. Well, the joke's on me because I spent so much time perfecting our itinerary that I forgot to put gas in my car before the trip.
See also: on
Farlex Dictionary of Idioms.

the joke’s on ˈsb

(informal) used to say that somebody who tried to make another person look ridiculous now looks ridiculous instead
See also: on, Sb
Farlex Partner Idioms Dictionary
See also:
  • get a taste of (one's) own medicine
  • drive (one) out of office
  • force (one) out of office
  • force out of office
  • give (one) (one's) head
  • give head
  • give somebody their head
  • give someone their head
  • cooking for one
  • 1FTR