Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:18:80

And as for the boy, his parents were believers, and we feared that he would overburden them by transgression and disbelief.  

And as for the boy, his parents were believers and We feared lest he should overwhelm them with insolence and disbelief — for he is as ˹described˺ by the hadīth of Muslim, ‘He was ˹incorrigibly˺ disposed to disbelief, and had he lived ˹longer˺ this ˹disposition of his˺ would have oppressed them, because of their love for him, they would have followed him in such ˹a path of disbelief˺’.
القرآن:١٨:٨٠

وَأَمَّا الْغُلَامُ فَكَانَ أَبَوَاهُ مُؤْمِنَيْنِ فَخَشِينَا أَنْ يُرْهِقَهُمَا طُغْيَانًا وَكُفْرًا  

{وأما الغلام فكان أبواه مؤمنين فخشينا أن يرهقهما طغيانا وكفرا} فإنه كما في حديث مسلم طبع كافرا ولو عاش لأرهقهما ذلك لمحبتهما له يتبعانه في ذلك.