What we do see in scripture is that God's merciful judgment takes ignorance into strong consideration.
"And should not I pity Nineveh, that great city, in which there are more than 120,000 persons who do not know their right hand from their left..." — Jonah 4:11
Here, God justifies His mercy on the Ninevites not by their righteousness, but by their lack of understanding. He is patient with them because they don't know better. The implication is that moral ignorance, not willful rebellion, was a key reason for God’s mercy.
“Father, forgive them, for they know not what they do.” --Luke 23:34
Jesus prays this on the cross for His executioners. Again, ignorance—“they know not what they do”—is cited as a reason for forgiveness. Jesus appeals to the Father's mercy on the grounds of their lack of understanding.
“And that servant who knew his master’s will but did not get ready or act according to his will, will receive a severe beating. But the one who did not know, and did what deserved a beating, will receive a light beating.” -- Luke 12:47–48
This parable clearly illustrates graduated responsibility: the more knowledge you have, the more accountable you are. Those in ignorance are still responsible—but less severely judged. (This is also a passage of great caution for those of us who think we know what God wants from us.)
"Jesus said to them, ‘If you were blind, you would have no guilt; but now that you say, ‘We see,’ your guilt remains.’" -- John 9:41
If they truly lacked knowledge or understanding (spiritual blindness not by choice), they wouldn’t be held fully accountable. Since they claim to know, they’re morally responsible for rejecting the truth. When Jesus says, “If you were blind, you would have no guilt,” He’s affirming that true ignorance can mitigate culpability.
Paul introduces the same principle—that God judges based on what people know—in Romans 1, but he frames it negatively to highlight human guilt and the fairness of divine judgment.
Romans 1:19, 20 is the negative mirror image of the same moral principle: that God judges according to what people know. But here, Paul is not talking about those who are ignorant. Instead, he condemns those who had enough knowledge of God to respond rightly—but chose not to.
"For what can be known about God is plain to them, because God has shown it to them. For his invisible attributes, namely, his eternal power and divine nature, have been clearly perceived, ever since the creation of the world, in the things that have been made. So they are without excuse." -- Romans 1:19, 20.
Paul is saying that God has made certain truths universally visible in creation, everyone knows—at least at a basic, intuitive level—about God’s power and divine nature, but they refused to acknowledge Him, and thus they are without excuse. The implication is certainly that those who are profoundly ignorant do have an excuse.
The biblical principle illustrated in these passages that God considers ignorance and understanding in judgment strongly supports the view that God is merciful to infants who die. Infants do not yet know "their right hand from their left" (Jonah 4:11), nor can they understand God’s will or even recognize His existence from creation. Infants are profoundly ignorant. They cannot knowingly reject God.