The Messenger of Allah ﷺ was asked about the children of the polytheists, and he replied, "Allah knows best what they would have done."
حدثنا سفيان عن أبي الزناد عن عبد الرحمن بن هرمز الأعرج
سئل رسول الله ﷺ عن أطفال المشركين فقال الله أعلم بما كانوا عاملين
Its isnad is sahih. Muslim narrated it, slightly longer, 2:202, through Sufyan, with this same isnad. Bukhari narrated it, 3:196, 11:432, through the narration of Ata bin Yazid Laythi from Abu Hurairah. Likewise, Muslim narrated it, 2:202, and Ibn Hibban in his Sahih, 131 in our edition, through the narration of Ata Laythi. Its meaning has already appeared several times in the hadith of Ibn Abbas, including 1845 and 3367.