Ubayd b. Umayr: a mother lifts her baby above the Flood; God says 'Had I been merciful to any of them, I would have had mercy on her'
Moral Problems Allah's Character Basic Musannaf Ibn Abi Shayba 37740"Allah said: Had I been merciful to any one of them, I would have had mercy on her (meaning, because of her mercy to the boy)."
What the hadith says
This is a story told by 'Ubayd b. 'Umayr al-Laythi, a Successor and preacher of Mecca, not a hadith of the Prophet. Ibn Abi Shayba records it in his chapter on 'Ubayd's sayings (37740) through Waki', al-A'mash and Mujahid, who heard 'Ubayd tell it: when Noah's people were drowning, a woman among them held a baby boy; she lifted him to her waist, and when the water reached him to her chest, and when it reached him again to her breasts. Then 'Allah said: Had I been merciful to any one of them, I would have had mercy on her', which the text explains as 'because of her mercy to the boy'. The al-Hut edition has the same (35009). No grading of the report was found, and it is not in the six books.
Why this is a problem
The story is told in praise of a mother's mercy, and it makes God acknowledge it. Yet she drowns, and so does the baby she is holding above the water. God's own words in the story concede that there was something in her worth mercy and then decline to show any: 'had I been merciful to any of them'. The child, who has done nothing, is not even mentioned as a candidate for mercy.
That is the moral difficulty of the Flood in miniature. The Quran tells of Noah's people drowned, and the tradition, when it imagines one mother and one infant inside that judgement, does not soften it. It portrays a mother more merciful to her child than God is to either of them.
The Muslim response
No Muslim answer to this story was found on a linkable page. The standard answer is that it is a preacher's story, not revelation, and carries no authority. On the substance, Muslims hold that the Flood was a just punishment of a people who rejected their prophet for centuries, that children who die are not punished in the hereafter, and that God's mercy in the next life is not measured by events in this one.
Why it fails
That answer is largely right on authority, and the entry is rated Basic: this is 'Ubayd's story, ungraded, and binds no one. But it was told by a well-known early preacher and kept by Ibn Abi Shayba among his sayings, which shows how the early tradition chose to picture divine judgement. It did not imagine a God who spared the infant.
Saying that the child is not punished in the hereafter concedes that he was drowned here, in a punishment aimed at others. The story's own God explains the outcome by saying that He would not be merciful to any of them, not by any guilt of the mother or her child.