Sayyiduna Abu Jabirah bin al-Dahhak al-Ansari (may Allah be pleased with him) said: This verse was revealed about us, the Ansar: "And do not call one another by offensive nicknames" [Surah al-Hujurat: 11]. The Messenger of Allah (peace and blessings be upon him) came, and every man had two or three names. Sometimes the Messenger of Allah (peace and blessings be upon him) would call someone by one of those names, and it would be said: "O Messenger of Allah, he becomes angry at that name." So this verse was revealed: "And do not call one another by offensive nicknames."
Hadith Referenceالمعجم الكبير للطبراني / مسند من يعرف بالكنى / 19172