Bricks & Yishmael - Seeking To Resolve A Troubling Midrash
Rashi's commentary to Parshas Ki Sissa references (Shemos 32:4) a midrash that I have always found troubling.
The midrash relates a story that while the Jews were enslaved in Egypt, Pharaoh decreed that the Jews cement their children into the walls of buildings if they could not meet making their quota of bricks. There was a great outcry, and Moshe Rabbeinu brought the complaint of Jewish people to Hashem. Hashem responded to Moshe that if He will allow these children to live they will eventually turn out to be wicked in the future, and further instructed Moshe to save one of these children to later validate His claim. Moshe saved a child named Micah, and Shoftim 17:5 relates that indeed this child later went on to make an worship an idol.
I am troubled with this midrash when I compare it to the midrash surrounding the episode of Hagar praying to Hashem to save her son Yishmael from dying of thirst in the desert (see Rashi's comment to Bereishis 21:17) :
The ministering angels were accusing and saying, "O Lord of the Universe, for one [Yishmael] who is destined to kill Your children with thirst, You are bringing up a well?!"
And He answered them, "What is he now, righteous or wicked?"
They replied, "Righteous."
He said to them, "According to his present deeds I judge him."
Rashi's commentary notes that the Gemara in Rosh Hashanah 16b states, "According to the deeds that he does now he is judged and not according to what he is destined to do." If this was indeed the case, how could have Hashem condemned the children who were cemented into walls in Egypt? What had they all done in their short lives that warranted a death sentence?
Rashi states in his comment to Sanhedrin 103b that Micah brought along an idol when he left Egypt. Obviously, this made him worthy of death. However, the question that remains is had he worshipped idols even as a small child before he was cemented into the brick?
How could Hashem have condemned Micah based on "his present deeds"? What made him different from Yishmael?