Wiktionary
the joke is on someone
phr. (context idiomatic English) The person who made the joke himself became the subject of a joke.