The teacher made several mistakes.
1) If you’re going to set students on a troublemaker, you have to be discreet about it, and use language that can have one or more non-violent interpretations.
This goes all the way back to England’s Henry II, who it is said, remarked to no one in particular “Will no one rid me of this turbulent priest?”, while referring to Thomas Becket. (In truth, it is thought he actually said “What miserable drones and traitors have I nourished and brought up in my household, who let their lord be treated with such shameful contempt by a low-born cleric?”)
In any event, the idea is the same. Plausible deniability.
2) Never gloat. In fact, she should have done the opposite, and immediately come to the bad students’ aid, offering him assistance and support. This also would give her credibility in confusing the description of the assailants, to aid in their avoidance of punishment, if they are discreet enough to not brag about it.
You are quite right. I had a couple of coaches/PE teachers in junior and high school who operated this way.
Remove the pebble from my shoe!