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:28:8

And the family of Pharaoh picked him up ˹out of the river˺ so that he would become to them an enemy and a ˹cause of˺ grief. Indeed, Pharaoh and Haman and their soldiers were deliberate sinners.  

Then Pharaoh’s folk, aids, picked him up, with him ˹still˺ in the basket, the morning following that night — it was placed him in front of him ˹Pharaoh˺ and then opened and Moses was brought out of it, sucking milk from his thumb — to be, at the end of the affair, an enemy, slaying their menfolk, and a ˹cause of˺ grief to them, enslaving their womenfolk (a variant reading ˹for hazanan˺ is huznan, both of which are alternative forms of the verbal noun, and it functions as an active participle, derived from hazanahu, which is like ahzanahu, ‘he caused him grief’). Truly Pharaoh and, his minister, Hāmān, and their hosts were sinners, that is, disobedient, and so they were punished at his ˹Moses’s˺ hands.
القرآن:٢٨:٨

فَالْتَقَطَهُ آلُ فِرْعَوْنَ لِيَكُونَ لَهُمْ عَدُوًّا وَحَزَنًا ۗ إِنَّ فِرْعَوْنَ وَهَامَانَ وَجُنُودَهُمَا كَانُوا خَاطِئِينَ  

{فالتقطه} بالتابوت صبيحة الليل {آل} أعوان {فرعون} فوضعوه بين يديه وفتح وأخرج موسى منه وهو يمص من إبهامه لبناً {ليكون لهم} في عاقبة الأمر {عدواً} يقتل رجالهم {وحزناً} يستعبد نساءهم وفي قراءة بضم الحاء وسكون الزاي لغتان في المصدر وهو هنا بمعنى اسم الفاعل من حزنه كأحزنه {إن فرعون وهامان}. وزيره {وجنودهما كانوا خاطئين} من الخطيئة أي عاصين فعوقبوا على يديه.