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:85

Indeed, ˹O Muhammad˺, He who imposed upon you the Qur'an will take you back to a place of return. Say, "My Lord is most knowing of who brings guidance and who is in clear error."  

Indeed He Who has prescribed for you the Qur’ān, ˹He Who˺ has revealed it, will surely restore you to a place of return, to Mecca — he had yearned for it. Say: ‘My Lord knows best him who brings guidance and him who is in manifest error’ — this was revealed in order to refute what the Meccan disbelievers had said to him: ‘Indeed, you are error’. In other words ˹God is saying that˺ he ˹the Prophet˺ is the one who has brought guidance, while they are the ones in error.
القرآن:٢٨:٨٥

إِنَّ الَّذِي فَرَضَ عَلَيْكَ الْقُرْآنَ لَرَادُّكَ إِلَىٰ مَعَادٍ ۚ قُلْ رَبِّي أَعْلَمُ مَنْ جَاءَ بِالْهُدَىٰ وَمَنْ هُوَ فِي ضَلَالٍ مُبِينٍ  

{إن الذي فرض عليك القرآن} أنزله {لرادّك إلى معاد} إلى مكة وكان قد اشتاقها {قل ربي أعلم من جاء بالهدى، ومن هو في ضلال مبين} نزل جواباً لقول كفار مكة له: إنك في ضلال، أي فهو الجائي بالهدى، وهم في ضلال وأعلم بمعنى عالم.