The Messenger of Allah ﷺ said, "Whoever seeks the office of judge will be left to himself, and whoever is compelled to take it on, Allah will send down upon him an angel to guide him to what is right."
حدثنا هناد حدثنا وكيع عن إسرائيل عن عبد الأعلى عن بلال بن أبي موسى
قال رسول الله ﷺ من سأل القضاء وكل إلى نفسه ومن أجبر عليه ينزل الله عليه ملكا فيسدده
[Its chain of transmission is daif] Ibn Majah also narrated it in the Rulings chapter, section on the mention of judges, no. 2309, from the hadith of Waki, with the same wording. Abdul-Ala Thalabi is daif, as noted in Tashil al-Hajah, no. 1552.