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:4:60

Have you not seen those who claim to have believed in what was revealed to you, ˹O Muhammad˺, and what was revealed before you? They wish to refer legislation to Taghut, while they were commanded to reject it; and Satan wishes to lead them far astray.  

The following verse was revealed when a Jew and a hypocrite fell into a dispute. The hypocrite called on Ka‘b b. al-Ashraf, to arbitrate between them, while the Jew called on the Prophet (s). When they came to him, the Prophet ruled in favour of the Jew. But the hypocrite was not satisfied, and so they went before ‘Umar. The Jew told him what had happened, whereupon he ˹‘Umar˺ turned to the hypocrite and asked him, ‘Is this true?’, and when he replied, ‘Yes’, he ˹‘Umar˺ killed him. Have you not seen those who claim that they believe in what has been revealed to you, and what was revealed before you, desiring to take their disputes to a false deity (tāghūt), one excessive in tempting ˹others˺ to falsehood (tughyān), namely, Ka‘b b. al-Ashraf, when they have been commanded to renounce him?, and not to associate with him. But Satan desires to mislead them, far astray, from the truth.
القرآن:٤:٦٠

أَلَمْ تَرَ إِلَى الَّذِينَ يَزْعُمُونَ أَنَّهُمْ آمَنُوا بِمَا أُنْزِلَ إِلَيْكَ وَمَا أُنْزِلَ مِنْ قَبْلِكَ يُرِيدُونَ أَنْ يَتَحَاكَمُوا إِلَى الطَّاغُوتِ وَقَدْ أُمِرُوا أَنْ يَكْفُرُوا بِهِ وَيُرِيدُ الشَّيْطَانُ أَنْ يُضِلَّهُمْ ضَلَالًا بَعِيدًا  

ونزل لما اختصم يهودي ومنافق فدعا المنافق إلى كعب بن الأشرف ليحكم بينهما ودعا اليهودي إلى النبي ﷺ فأتياه فقضى لليهودي فلم يرض المنافق وأتيا عمر فذكر اليهودي ذلك فقال للمنافق أكذلك فقال نعم فقتله {ألم ترَ إلى الذين يزعمون أنهم آمنوا بما أنزل إليك وما أُنزل من قبلك يريدون أن يتحاكموا إلى الطاغوت} الكثير الطغيان وهو كعب بن الأشرف {وقد أمروا أن يكفروا به} ولا يوالوه {ويريد الشيطان أن يضلَّهم ضلالا بعيدا} عن الحق.

See similar narrations below:

Collected by Ṭabarānī
tabarani:12045Abū Zayd Aḥmad b. Yazīd al-Ḥawṭī > Abū al-Yamān > Ṣafwān b. ʿAmr > ʿIkrimah > Ibn ʿAbbās

[Machine] Abu Barzah al-Aslami used to judge between the Jews in their disputes that they brought to him. Then some Muslims sought his judgment, so Allah revealed, "Have you not seen those who claim to believe in what was revealed to you and what was revealed before you? They wish to turn to the taghut [false judge] for judgment, while they were commanded to disbelieve in it" until His saying, "But if you should strive for Allah, He is your best for striving" (Surah An-Nisa, verse 60).  

الطبراني:١٢٠٤٥حَدَّثَنَا أَبُو زَيْدٍ أَحْمَدُ بْنُ يَزِيدَ الْحَوْطِيُّ ثنا أَبُو الْيَمَانِ ثنا صَفْوَانُ بْنُ عَمْرٍو عَنْ عِكْرِمَةَ عَنِ ابْنِ عَبَّاسٍ قَالَ

كَانَ أَبُو بَرْزَةَ الْأَسْلَمِيُّ كَاهِنًا يَقْضِي بَيْنَ الْيَهُودِ فِيمَا يَتَنَافَرُونَ إِلَيْهِ فتنافرَ إِلَيْهِ نَاسٌ مِنَ الْمُسْلِمِينَ فَأَنْزَلَ اللهُ ﷻ {أَلَمْ تَرَ إِلَى الَّذِينَ يَزْعُمُونَ أَنَّهُمْ آمَنُوا بِمَا أُنْزِلَ إِلَيْكَ وَمَا أُنْزِلَ مِنْ قَبْلِكَ يُرِيدُونَ أَنْ يَتَحاكَمُوا إِلَى الطاغوتِ وَقَدْ أُمِرُوا أَنْ يَكْفُرُوا بِهِ} إِلَى قَوْلِهِ {إِنْ أَرَدْنَا إِلَّا إِحْسَانًا}