He wrote that the Messenger of Allah ﷺ said, "A judge must not rule between two parties while he is angry."
حدثنا وكيع حدثنا سفيان وعبد الرحمن عن سفيان عن عبد الملك بن عمير
أنه كتب أن رسول الله ﷺ قال لا يقضي الحاكم بين اثنين وهو غضبان
Its isnad is sahih. The hadith is found in Bukhari 13/136, no. 7158, Fath al-Bari, in the Book of Judgments, chapter on whether a judge may pass judgment or issue a ruling while angry, and in Muslim 3/1342, no. 1717, in the Book of Judgments. Similarly in Abu Dawud 2/301, no. 3579, and Tirmidhi 3/611, no. 1334, in the Book of Judgments, where he said, hasan sahih. It is found in all the leading imams' collections, and it is the foundation upon which judicial rulings are based.