NASAI-KUBRA 7781: from Ibn ʿUmar —
It is obligatory upon a Muslim that he should listen (to the ruler appointed over him) and obey him whether he likes it or not, except that he is ordered to do a sinful thing. If he is ordered to do a sinful act, a Muslim should neither listen to him nor should he obey his orders. (Using translation from Muslim 1839a)

الكبرى للنسائي ٧٧٨١: عن ابن عمر —
قَالَ رَسُولُ اللهِ ﷺ «عَلَى الْمَرْءِ الْمُسْلِمِ السَّمْعُ وَالطَّاعَةُ فِيمَا أَحَبَّ وَكَرِهَ إِلَّا أَنْ يُؤْمَرَ بِمَعْصِيَةٍ فَإِذَا أُمِرَ بِمَعْصِيَةٍ فَلَا سَمْعَ وَلَا طَاعَةَ»


No Grade (N/A)
Nasāʾī's Kubrá > Pledges > § [Machine] The reward for someone who is commanded to...
hadithunlocked.com