The Messenger of Allah ﷺ said, "A judge must not pass judgment between two parties while he is angry."
حدثنا هشيم أخبرنا عبد الملك بن عمير
قال رسول الله ﷺ لا يقضي القاضي بين اثنين وهو غضبان
Its isnad is sahih, it previously appeared at 20258.