Abdullah bin Umar reported,

Zayd bin Haritha was the freed slave of the Messenger of Allah ﷺ, and we called him nothing but Zayd bin Muhammad until the Quran was revealed, "Call them after their fathers, that is more just in the sight of Allah" [Ahzab 33:5].

Azami 13030

Sahih

عن عبد الله بن عمر

أن زيد بن حارثة مولى رسول الله ﷺ ما كنا ندعوه إلا زيد بن محمد حتى نزل القرآن {ادعوهم لآبائهم هو أقسط عند الله}

الأعظمي 13030صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Tafsir of Surah Ahzab
Section
His saying, "Call them by their fathers. It is more just in the sight of Allah. But if you do not know their fathers, then they are your brothers in religion and your allies. And there is no blame upon you for what you did by mistake, but only for what your hearts intended. And Allah is Forgiving, Merciful."
Numbering
Jami al-Kamil 13030 (2nd edition)
Azami 13030