Saad bin Abu Waqqas and Abu Bakra reported,

My ears heard it and my heart retained it, that Muhammad ﷺ said, "Whoever claims descent from someone other than his father, knowing that he is not his father, Paradise is forbidden to him."

Azami 203

Sahih

عن سعد بن أبي وقاص، وأبي بكرة كلاهما يقول

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

الأعظمي 203صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Qualities of faith
Section
Clarification of the state of faith of one who disowns his father knowingly
Numbering
Jami al-Kamil 203 (2nd edition)
Azami 203