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.
*on the wrong side of someone
and *on someone's wrong sideFig. 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.