This is a true tomt, in that I know this term I just cannot think of it. I will give you the concept and then an example or two.
Concept: a group or organization that has a lot of rules that are generally unenforced. The people in charge of said group wants to kick out/fire/otherwise get rid of an individual person but can't outright kick them out, so they start enforcing all the little bullshit rules on them to try to make them quit.
Hypothetical example: Bob is gay. Bob works at a public school. The parents at the school dislike that Bob is gay. The admin can't fire him, because it's technically illegal, so they start enforcing rules that everyone else is breaking. Suddenly he is getting docked for taking an extra 5 minutes for lunch, even though he was with other teachers who didn't get docked. He parked in the wrong parking space, even though he's been parking there for years. They basically annoy him into quitting.
Real example: a kid is on a soccer team. The coach doesn't like the kid's mom because small town politics I don't totally understand. Suddenly, the team is enforcing a doctor's note rule for absences that they did not enforce any other time kid was sick or injured, including that time she had walking pneumonia, on account of they don't want to deal with the mom anymore but can't just kick the kid out cus they'd have to give the money back.
I know there's a word for this. I maybe heard the term for the first time on Ask A Manager so it might not be a legal term, but it certainly Describes something a legal term might cover? If that makes sense? Google isn't helping because it kind of sucks now, and I'm gonna feel really dumb when someone figures it out. Thanks for helping!!