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:6:77

And when he saw the moon rising, he said, "This is my lord." But when it set, he said, "Unless my Lord guides me, I will surely be among the people gone astray."  

And when he saw the moon rising, appearing, he said, to them: ‘This is my Lord.’ But when it set he said, ‘Unless my Lord guides me, ˹unless˺ He establishes me within ˹true˺ guidance, I shall surely become one of the folk who are astray’ — an intimation to his people that they are astray, but still this had no effect on them.
القرآن:٦:٧٧

فَلَمَّا رَأَى الْقَمَرَ بَازِغًا قَالَ هَٰذَا رَبِّي ۖ فَلَمَّا أَفَلَ قَالَ لَئِنْ لَمْ يَهْدِنِي رَبِّي لَأَكُونَنَّ مِنَ الْقَوْمِ الضَّالِّينَ  

{فما رأى القمر بازغا} طالعا {قال} لهم {هذا ربي فلما أفل قال لئن لم يهدني ربي} يثبتني على الهدى {لأكوننَّ من القوم الضَّالين} تعريض لقومه بأنهم على ضلال فلم ينجع فيهم ذلك.