the joke is on someone

US /ðə dʒoʊk ɪz ɑn ˈsʌmˌwʌn/
UK /ðə dʒoʊk ɪz ɑn ˈsʌmˌwʌn/
"the joke is on someone" picture
1.

la broma le salió cara a alguien, la broma se volvió contra alguien

used to say that someone who has tried to make another person look silly has in fact been made to look silly themselves

:
He thought he was being clever by tricking me, but the joke is on him now that I've exposed his lies.
Pensó que era listo al engañarme, pero la broma le salió cara ahora que he expuesto sus mentiras.
They tried to embarrass her with a prank, but when it backfired, the joke was on them.
Intentaron avergonzarla con una broma, pero cuando les salió mal, la broma les salió cara.