Anas b. Malik reported that Umm Sulaim narrated it that she asked the Messenger of Allah (ﷺ) about a woman who sees in a dream what a man sees (sexual dream). The Messenger of Allah (may peace be upon him) said: In case a woman sees that, she must take a bath. Umm Sulaim said: I was bashful on account of that and said: Does it happen? Upon this the Messenger of Allah (ﷺ) said: Yes (it does happen), otherwise how can (a child) resemble her? Man's discharge (i. e. sperm) is thick and white and the discharge of woman is thin and yellow; so the resemblance comes from the one whose genes prevail or dominate.
I'm not questioning the part about it dominating which is clearly correct, nor the existence of a yellow fluid that influences fertilization. The only issue, which is coincidentally the only one that could be verified empirically is discharges being yellow. Women's nocturnal emissions are nearly always white, and nocturnal emissions aren't the same yellow fluid that's needed in fertilization which is follicular fluid. Thus the discharge mentioned in this very case has no role in fertilization at all let alone in determining the resemblance of a child to one of the parents. Could it be that this was just an assumption from the Prophet's part and that it is totally acceptable for him to be wrong in this case in particular? I'm confident there's a minority opinion that concerning issues not pertaining religion he is liable to making mistakes, especially in science according to Ibn Khaldun, Shah Waliullah and even Qadi Ayyad. I'd argue that the only part that constitutes a religious ruling is the part where he says that if she sees a dream and sees a fluid, this requires ghusl. This part is unequivocally free of error since the Prophet could never make a mistake in religious Ijtihad, just like the information he received through Jibreel cannot in any way be considered false. As for the revelation that he got from Jibreel (AS) after being questioned by Abdullah bin Salam, it only concerned fluid domination determining resemblance to a parent according to the ahadith I've seen (correct me if I'm wrong). Even Dr. Al Barr makes the distinction between the two types of fluid, namely the white sticky one that has no role in making children, and the yellowish one secreted into the fallopian tubes, but he does not mention this apparent contradiction in the hadith. JazakAllah khayr