(29) بَابُ مَنْ قُضِيَ لَهُ بِحَقِّ أَخِيهِ فَلاَ يَأْخُذْهُ، فَإِنَّ قَضَاءَ الْحَاكِمِ لاَ يُحِلُّ حَرَامًا وَلاَ يُحَرِّمُ حَلاَلاً
Narrated Um Salama:
(the wife of the Prophet) Allah's Messenger (ﷺ) heard some people quarreling at the door of his dwelling, so he went out to them and said, "I am only a human being, and litigants with cases of dispute come to me, and someone of you may happen to be more eloquent (in presenting his case) than the other, whereby I may consider that he is truthful and pass a judgment in his favor. If ever I pass a judgment in favor of somebody whereby he takes a Muslim's right unjustly, then whatever he takes is nothing but a piece of Fire, and it is up to him to take or leave."
Reference: Sahih al-Bukhari 7181
In-book reference: Book 93, Hadith 44
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 9, Book 89, Hadith 292