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:3:149

O you who have believed, if you obey those who disbelieve, they will turn you back on your heels, and you will ˹then˺ become losers.  

O you who believe, if you obey the disbelievers, in what they command you, they will make you turn back on your heels, ˹back˺ to unbelief, and you will revert as losers.
القرآن:٣:١٤٩

يَا أَيُّهَا الَّذِينَ آمَنُوا إِنْ تُطِيعُوا الَّذِينَ كَفَرُوا يَرُدُّوكُمْ عَلَىٰ أَعْقَابِكُمْ فَتَنْقَلِبُوا خَاسِرِينَ  

{يا أيها الذين آمنوا إن تطيعوا الذين كفروا} فيما يأمرونكم به {يردوكم على أعقابكم} إلى الكفر {فتنقلبوا خاسرين}.