Amr bin As reported,

He heard the Messenger of Allah ﷺ say, "When a judge gives a ruling and exercises his best judgment and then arrives at the right decision, he receives two rewards. When he gives a ruling and exercises his best judgment and then errs, he receives one reward."This is the narration of Abdul-Aziz bin Muhammad, with both chains of transmission together.

Muslim 4489

Sahih

و حدثني عبد الله بن عبد الرحمن الدارمي أخبرنا مروان يعني ابن محمد الدمشقي حدثنا الليث بن سعد حدثني يزيد بن عبد الله بن أسامة بن الهاد الليثي بهذا الحديث مثل رواية عبد العزيز بن محمد بالإسنادين جميعا

مسلم 4489صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Judgments
Chapter
Clarification of the reward for a judge if he exercises ijtihad and is correct or mistaken
Numbering
Darussalam 4489
Muslim 4489