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:10:89

˹Allah˺ said, "Your supplication has been answered." So remain on a right course and follow not the way of those who do not know."  

He, ˹God˺ exalted be He, said, ‘Your prayer has been answered: thus their riches were transformed into stones and Pharaoh did not believe until he was about to drown. So the two of you remain upright, with the Message and the Call until such time as chastisement befalls them, and do not follow the way of those who have no knowledge’, when they seek to hasten on My judgement — it is reported that he ˹Moses˺ remained ˹alive˺ a further forty years thereafter.
القرآن:١٠:٨٩

قَالَ قَدْ أُجِيبَتْ دَعْوَتُكُمَا فَاسْتَقِيمَا وَلَا تَتَّبِعَانِّ سَبِيلَ الَّذِينَ لَا يَعْلَمُونَ  

{قال} تعالى {قد أجيبت دعوتكما} فمسخت أموالهم حجارة ولم يؤمن فرعون حتى أدركه الغرق {فاستقيما} على الرسالة والدعوة إلى أن يأتيهم العذاب {ولا تتبعان سبيل الذين لا يعلمون} في استعجال قضائي روي أنه مكث بعدها أربعين سنة.