This verse was revealed about us, the Banu Salimah: "Nor call each other by (offensive) nicknames: ill-seeming is a name connoting wickedness (to be used of one) after he has believed." He said: When the apostle of Allah ﷺ came to us, every one of us had two or three names. The Messenger of Allah ﷺ began to say: O so and so! But they would say: Keep silence, Messenger of Allah! He becomes angry by this name. So this verse was revealed: "Nor call each other by (offensive) nicknames."
فِينَا نَزَلَتْ هَذِهِ الآيَةُ فِي بَنِي سَلِمَةَ { وَلاَ تَنَابَزُوا بِالأَلْقَابِ بِئْسَ الاِسْمُ الْفُسُوقُ بَعْدَ الإِيمَانِ } قَالَ قَدِمَ عَلَيْنَا رَسُولُ اللَّهِ ﷺ وَلَيْسَ مِنَّا رَجُلٌ إِلاَّ وَلَهُ اسْمَانِ أَوْ ثَلاَثَةٌ فَجَعَلَ النَّبِيُّ ﷺ يَقُولُ يَا فُلاَنُ فَيَقُولُونَ مَهْ يَا رَسُولَ اللَّهِ إِنَّهُ يَغْضَبُ مِنْ هَذَا الاِسْمِ فَأُنْزِلَتْ هَذِهِ الآيَةُ { وَلاَ تَنَابَزُوا بِالأَلْقَابِ }