A man came to the Prophet ﷺ, and he mentioned the hadith, in which he said, "She was pregnant." He denied her pregnancy, and her son was attributed to her.
أن رجلا أتى النبي ﷺ فذكر الحديث وقال فيه: وكانت حاملا. فأنكر حملها، وكان ابنها يدعى إليها.
Bukhari related it in the Tafsir (4746) from Sulayman bin Dawud Abu Rabi, who said, Fulayh told us, from Zuhri, from Sahl bin Saad, and he mentioned it. Muslim related it in the Lian (2/1492) through Yunus, from Ibn Shihab, with a similar wording. And in Sunan Abu Dawud (2247) through Yunus, "I witnessed their lian before the Messenger of Allah ﷺ when I was fifteen years old," and he continued the hadith. In it he said, "Then she went out pregnant." So the child was attributed to his mother.