It is narrated from Abdullah bin al-Zubayr (may Allah be pleased with him) that Zam'ah had a slave-girl with whom he used to have intercourse, and a man used to follow her and was suspected with her. Zam'ah died while the slave-girl was pregnant, and she gave birth to a boy who resembled the man who had been suspected with her. Sawdah (may Allah be pleased with her) asked the Prophet (peace and blessings be upon him) about this, and he (peace and blessings be upon him) said: "As for the inheritance, it is his (the boy's); as for you, observe hijab from him, for he is not your brother."
The chain of this hadith does not stand up to the chain of the first hadith, because the narrators of the first hadith are well known for memory, understanding and trustworthiness, and Aishah (may Allah be pleased with her) relates that story as though she witnessed it, whereas among the narrators of the other hadith is one who was described as having poor memory at the end of his life, namely Jarir bin Abd al-Hamid, and among them is one who is not known for anything by which his hadith could be established, namely Yusuf bin al-Zubayr. Abdullah bin al-Zubayr (may Allah be pleased with him) seemingly did not witness the incident because of his young age. So the narration of the one who witnessed it, all of whose chain are trustworthy hafiz narrators well known for understanding and uprightness, is more worthy of being adopted, and Allah knows best.
If he (peace and blessings be upon him) did say it, his words may mean: he is not your brother in resemblance, even though by the ruling of the bed he is your brother. So it does not contradict his saying: "O Abd! He is your brother." For he attached him to the bed, to the point of ruling inheritance for him.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الإقرار / 11466