The Prophet ﷺ said, "Judges are of three kinds, two are in the Fire and one is in the Paradise. A man who judged unjustly knowing the truth, he is in the Fire. A judge who lacked knowledge and so destroyed people's rights, he is in the Fire. And a judge who judged with truth, he is in the Paradise."
حدثنا محمد بن إسمعيل حدثني الحسن بن بشر حدثنا شريك عن الأعمش عن سعد بن عبيدة
أن النبي ﷺ قال القضاة ثلاثة قاضيان في النار وقاض في الجنة رجل قضى بغير الحق فعلم ذاك فذاك في النار وقاض لا يعلم فأهلك حقوق الناس فهو في النار وقاض قضى بالحق فذلك في الجنة
No references are available.
[Its chain is daif] Abu Dawud narrated it in the Book of Judgments, Chapter on the Judge Who Errs, no. 3573, and Ibn Majah, no. 2315, from the hadith of Ibn Burayda, with Amash and Sharik both narrating it using "an" without specifying direct hearing. It has a daif corroborating narration in Tabarani (Majma, 4/193).