Umm Salama bint Abu Umaya reported,

The Messenger of Allah ﷺ heard a dispute at the door of his chamber, so he went out to them and said, "I am only a human being, and disputants come to me. One of you may be more eloquent than the other, so I assume he is truthful and rule in his favor. Whoever I rule in his favor with something that belongs to a Muslim by right, it is only a piece of the Fire, so let him take it or leave it."

Azami 6721

Sahih

عن أم سلمة زوج النبي ﷺ

أن رسول الله ﷺ سمع خصومة بباب حجرته، فخرج إليهم فقال: إنما أنا بشر، وإنه يأتيني الخصم، فلعل بعضكم أن يكون أبلغ من بعض، فأحسب أنه صادق فأقضي له بذلك، فمن قضيت له بحق مسلم، فإنما هي قطعة من النار، فليأخذها أو ليتركها.

الأعظمي 6721صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Judgeship
Chapter
Conduct of the judge
Section
Judge's ruling does not make lawful what is unlawful, nor does it make unlawful what is lawful
Numbering
Jami al-Kamil 6721 (2nd edition)
Azami 6721