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

And a believing man from the family of Pharaoh who concealed his faith said, "Do you kill a man ˹merely˺ because he says, 'My Lord is Allah' while he has brought you clear proofs from your Lord? And if he should be lying, then upon him is ˹the consequence of˺ his lie; but if he should be truthful, there will strike you some of what he promises you. Indeed, Allah does not guide one who is a transgressor and a liar.  

Then said a believing man from among Pharaoh’s folk — this is said to have been his paternal cousin — who had concealed his faith, ‘Will you slay a man for saying, “My Lord is God”, even though he has ˹also˺ brought you clear signs, manifest miracles, from your Lord? If he is lying, then his mendacity will be to his own detriment, that is, the harm resulting from his mendacity ˹will be to his own detriment˺; but if he is truthful, then there will befall you some of that with which he is threatening you, in the way of chastisement, soon. Truly God does not guide one who is a prodigal, an idolater, a liar.
القرآن:٤٠:٢٨

وَقَالَ رَجُلٌ مُؤْمِنٌ مِنْ آلِ فِرْعَوْنَ يَكْتُمُ إِيمَانَهُ أَتَقْتُلُونَ رَجُلًا أَنْ يَقُولَ رَبِّيَ اللَّهُ وَقَدْ جَاءَكُمْ بِالْبَيِّنَاتِ مِنْ رَبِّكُمْ ۖ وَإِنْ يَكُ كَاذِبًا فَعَلَيْهِ كَذِبُهُ ۖ وَإِنْ يَكُ صَادِقًا يُصِبْكُمْ بَعْضُ الَّذِي يَعِدُكُمْ ۖ إِنَّ اللَّهَ لَا يَهْدِي مَنْ هُوَ مُسْرِفٌ كَذَّابٌ  

{وقال رجل مؤمن من آل فرعون} قيل: هو ابن عمه {يكتم إيمانه أتقتلون رجلا أن} أي لأن {يقول ربيَ الله وقد جاءَكم بالبينات} بالمعجزات الظاهرات {من ربكم وإن يك كاذبا فعليه كذبه} أي ضرر كذبه {وإن يك صادقا يصبكم بعض الذي يعدكم} به من العذاب عاجلا {إن الله لا يهدي من هو مسرف} مشرك {كذاب} مفتر.