In the Talmud, Rabbi Elazar meets an "ugly" man and insults him: "Worthless person, how ugly you are! Are all the people of your city as ugly as you?" He quickly apologizes and asks for forgiveness. The town people urge him to forgive. He says to them: "For your sakes I forgive him, provided that he does not become accustomed to act that way." [Taanit 20a-b]
The Maharsha adds: We expected the man to say: "I forgive you provided that you don't behave like that again!". Instead he said: "I forgive you provided that you do not become accustomed to act that way.” The word "accustomed" indicates that such behavior is sometimes acceptable. [Chidushei Agadot]
Question: Under what conditions is such behavior "acceptable"?