the joke's on sb

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