The Messenger of Allah ﷺ said, "When a judge gives a ruling, exerting his utmost effort, and arrives at the correct decision, he receives two rewards. When he gives a ruling and errs, he still receives one reward."
قال رسول الله ﷺ: إذا حكم الحاكم فاجتهد فأصاب فله أجران، وإذا حكم فأخطأ فله أجر واحد.
Tirmidhi (1326), Nasai (5381), and Ibn Jarud (996) reported it, and Ibn Hibban (5060), Daraqutni (4/204), and Bayhaqi (10/119) graded it sahih, all of them from the hadith of Abdul-Razzaq, who said, Mamar informed us, from Sufyan Thawri, from Yahya bin Saeed, from Abu Bakr bin Amr bin Hazm, from Abu Salama, from Abu Hurairah, and he related it.Tirmidhi said, "This is a hasan gharib hadith by this route. We do not know it from the hadith of Sufyan Thawri, from Yahya bin Saeed, except through the hadith of Abdul-Razzaq, from Mamar, from Sufyan Thawri."Ibn Jarud said, "We do not know of anyone who narrated this hadith from Thawri other than Mamar."I say, this does not harm the hadith, for Mamar is trustworthy. There is some slight criticism regarding his narration from the Iraqis, but this does not affect the soundness of the hadith.