Abu Dharr reported,

He heard the Messenger of Allah ﷺ say, "There is no man who claims someone other than his father as his father, knowing he is not, except that he has committed disbelief. Whoever claims what does not belong to him is not one of us, and let him take his seat in the Fire. Whoever calls a man a disbeliever, or says, 'Enemy of Allah,' when he is not so, it rebounds upon himself."In Bukhari's wording, "Whoever claims to belong to a people to whom he does not belong, let him take his seat in the Fire."

Azami 14543

Sahih

عن أبي ذر

أنه سمع رسول الله ﷺ يقول: ليس من رجل ادعى لغير أبيه وهو يعلمه إلا كفر، ومن ادعى ما ليس له فليس منا، وليتبوأ مقعده من النار، ومن دعا رجلا بالكفر، أو قال: عدو الله وليس كذلك إلا حار عليه. وفي لفظ البخاري: ومن ادعى قوما ليس فيهم فليتبوأ مقعده من النار.

الأعظمي 14543صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Superior moral conduct
Chapter
Names, kunyas, and titles
Section
Discouragement from a man attributing himself to other than his father and to other than his freed slaves
Numbering
Jami al-Kamil 14543 (2nd edition)
Azami 14543