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.

المزحة انقلبت على, انقلبت المزحة على

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.
ظن أنه ذكي بخداعي، لكن المزحة انقلبت عليه الآن بعد أن كشفت أكاذيبه.
They tried to embarrass her with a prank, but when it backfired, the joke was on them.
حاولوا إحراجها بمقلب، ولكن عندما انقلب عليهم، انقلبت المزحة عليهم.