Right. Sorry.
Then the student needs to learn not to say it.
It is an unkind word with no context that is positive and shouldn’t be said. However, it was up to the teacher to take proper disciplinary measures, like reporting the student to the office and not take measures into hus own hands.