The Prophet ﷺ said, "Judges are of three kinds. One will be in Paradise, and two will be in the Fire. As for the one in Paradise, he is a man who recognized the truth and judged by it. A man who recognized the truth but ruled unjustly will be in the Fire, and a man who judged among people in ignorance will be in the Fire."
عن النبي ﷺ قال: القضاة ثلاثة، واحد في الجنة، واثنان في النار، فأما الذي في الجنة فرجل عرف الحق فقضى به، ورجل عرف الحق فجار في الحكم فهو في النار، ورجل قضى للناس على جهل فهو في النار.
Abu Dawud (3573), Ibn Majah (2315), Tahawi in his Mushkil (55), and Bayhaqi (116/10) all narrated it, each of them from the hadith of Khalaf bin Khalifa, from Abu Hashim, from Ibn Burayda, from his father, and he related it.Abu Dawud said, "This is the most sahih thing regarding it," meaning the hadith of Ibn Burayda.I say, its chain of transmission is hasan because of Khalaf bin Khalifa, for he is disputed, though his hadith is hasan. He has been corroborated, as shown by what Tirmidhi (1322) narrated, and Tahawi in his Mushkil (54), and what Hakim graded sahih (90/4), and Bayhaqi (117/10), all of them from the hadith of Sharik, from Amash, from Saad bin Ubayda, from Ibn Burayda, from his father, relating something similar.Sharik here is Sharik bin Abdullah Nakhai, who has weak memory, but he did not err in this narration since he was corroborated.Hakim has another chain, which he narrated from Abu Bakr bin Ishaq, who informed us from Muhammad bin Ghalib, who related to us from Shihab bin Abbad, who related to us from Abdullah bin Bukayr, from Hakeem bin Jubayr, from Abdullah bin Burayda, from his father, relating something similar.Hakim said, "It has a corroborating witness with a sahih chain according to the standard of Muslim," meaning by this the narration of Sharik bin Abdullah Nakhai. As for this chain, it contains Hakeem bin Jubayr Asadi, who is daif.As for what was narrated from Uqba bin Amir, who said, "Two disputants came to the Messenger of Allah ﷺ disputing, so he said to me, 'Get up, Uqba, and judge between them.' I said, 'Messenger of Allah, you are more entitled to that than I am.' He said, 'Even so, judge between them. If you exert your judgment and get it right, you will have ten rewards, and if you exert your judgment and err, you will have one reward,'" this is daif.Daraqutni narrated it (204/4). It contains Faraj bin Fadala bin Numan Tanukhi Shami, who is disputed, though the majority of the imams of hadith held the view of weakening him.The meaning of ijtihad by the judge only applies after there is, regarding the matter he wants to rule on, no Book, no sunnah, and no matter of consensus. But if any of that exists, then no. Al-Umm (6/200).Likewise, what was narrated from Abu Hurairah from the Prophet ﷺ is not sahih. He said, "Whoever seeks the judgeship of the Muslims until he attains it, and then his justice overcomes his injustice, will have Paradise, and whoever's injustice overcomes his justice will have the Fire."Abu Dawud (3575) narrated it from Abbas Anbari, who related to us from Umar bin Yunus, who related to us from Mulazim bin Amr, who related to me from Musa bin Najda, from his grandfather Yazid bin Abdul-Rahman, who is Abu Kathir, who related to me from Abu Hurairah, and he related it.Musa bin Najda Hanafi Yamami is unknown, as Hafiz said in Taqrib.