In my related question, What is the difference between mida k'negged mida and nekama, it was brought that the point of midda k'negged mida (one of the points, at least), is to help someone wake up to their negative behaviour.
This would make it an effective tool for humans to do to each other. However, as that question asks, for humans, that might count, or come uncomfortably close to revenge, which is an issur d'oraissa.
Nonetheless, is there any precedent for humans to do it to each other, to help each other understand what they are doing wrong? In any context, whether it be on the level of the court, or in interpersonal relationships, or in chinuch?
Please quote sources, not looking for personal opinions for this :)