The Prophet ﷺ said, "Whoever seeks the position of judge and asks others to intercede on his behalf to obtain it will be left to himself, but whoever is compelled to take it, Allah sends down upon him an angel to guide him to what is right."
حدثنا عبد الله بن عبد الرحمن أخبرنا يحيى بن حماد عن أبي عوانة عن عبد الأعلى الثعلبي عن بلال بن مرداس الفزاري عن خيثمة وهو البصري
عن النبي ﷺ قال من ابتغى القضاء وسأل فيه شفعاء وكل إلى نفسه ومن أكره عليه أنزل الله عليه ملكا يسدده
No references are available.
[Its chain of transmission is daif] See the previous hadith.