Imam al-Shafi'i (may Allah have mercy on him) said: "'And if you disagree over anything' [Surah al-Nisa: 59] means, and Allah knows best: they and their rulers whom they have been commanded to obey. 'Refer it to Allah and the Messenger' [Surah al-Nisa: 59] means, and Allah knows best: to what Allah and the Messenger have said."
And Allah Almighty said: "Does man think that he will be left neglected (sudan)?" [Surah al-Qiyamah: 36]
Imam al-Shafi'i (may Allah have mercy on him) said: "To my knowledge, the scholars of the Qur'an do not differ that 'sudan' is the one who is neither commanded nor forbidden anything. And whoever gives a fatwa or a judgement on something he was not commanded to, has permitted himself to fall within the meaning of 'sudan' (one left neglected)."
The Shaykh (Imam al-Bayhaqi) (may Allah have mercy on him) said: "And it has been narrated to us from Imam Mujahid (may Allah have mercy on him), in the interpretation of these two verses, something similar to what Imam al-Shafi'i (may Allah have mercy on him) said."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / Q20335