The Messenger of Allah ﷺ said, "When a judge gives a ruling and exerts his best effort and gets it right, he receives two rewards, and if he errs, he receives one reward."Yazid said, "I mentioned this to Abu Bakr bin Hazm, and he said, 'This is exactly how Abu Salama narrated it to me from Abu Hurairah from the Prophet ﷺ.'"
حدثنا أبو سعيد حدثنا عبد الله بن جعفر قال ثنا يزيد بن عبد الله عن محمد بن إبراهيم عن بسر بن سعيد عن أبي قيس مولى عمرو بن العاص
قال رسول الله ﷺ إذا حكم الحاكم فاجتهد فأصاب فله أجران وإن أخطأ فله أجر قال يزيد فذكرت ذلك لأبي بكر بن حزم فقال هكذا حدثني به أبو سلمة عن أبي هريرة عن النبي ﷺ بمثله
Its isnad is sahih, previously mentioned in 17702.17748 - Yazid said, "I mentioned that to Abu Bakr bin Hazm, and he said, 'That is how Abu Salama narrated it to me, from Abu Hurairah, from the Prophet ﷺ, with something similar.'"Sahih (17748). Its isnad is sahih.