on the wrong side of

on the wrong side of (someone)

Displeasing to someone; provoking someone's anger, contempt, or dismissal. The best way to get through this class is to say nothing unless called upon, and to make sure you don't get on the wrong side of the teacher! I thought it was all in good fun, but I might have gotten on the wrong side of her with my sarcastic comments.
See also: of, on, side, wrong
Farlex Dictionary of Idioms.

*on the wrong side of someone

 and *on someone's wrong side
Fig. out of favor with someone. (*Typically: be ~; get ~.) Don't get on the wrong side of her. I do what I can not to get on the wrong side of people.
See also: of, on, side, wrong
McGraw-Hill Dictionary of American Idioms and Phrasal Verbs.
See also:
  • on (someone's) wrong side
  • on the wrong side of (someone)
  • get in wrong with (someone)
  • get in wrong with someone
  • get on the bad side of (someone)
  • get on the wrong side of (someone)
  • get on (someone's) bad side
  • on (one's) wrong side
  • get someone's dander up, to
  • know the score