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:26:19

And ˹then˺ you did your deed which you did, and you were of the ungrateful."  

And you committed that deed of yours — namely, his slaying of the Egyptian — being an ingrate’, a denier of my favours to you in having reared you ˹among us˺ and not enslaved you.
القرآن:٢٦:١٩

وَفَعَلْتَ فَعْلَتَكَ الَّتِي فَعَلْتَ وَأَنْتَ مِنَ الْكَافِرِينَ  

{وفعلت فعلتك التي فعلت} هي قتله القبطي {وأنت من الكافرين} الجاحدين لنعمتي عليك بالتربية وعدم الاستعباد.