It was narrated from 'Amr bin 'As that he heard the Messenger of Allah (ﷺ) say:
“When the judge passes a judgement and does his best and gets it right, he will have two rewards, and if he passes a judgement and does his best and gets it wrong, he will have one reward.” (Sahih) Yazid (one of narrators) said : “So I Narrated it to Abu Bakr bin 'Amr bin Hazm. He said: 'This is how it was narrated to me by Abu Salamah from Abu Hurairah.'”