Sayyiduna Anas (may Allah be pleased with him) said that the Prophet (peace and blessings be upon him) said: "Whoever seeks the office of judge and has intercessors ask for it will be left to it, and whoever is compelled to take it, Allah Almighty appoints over him an angel who keeps him upright."
Abu Isa al-Tirmidhi said, according to what has reached me from him: This hadith is hasan gharib, and it is more authentic than the hadith of Isra'il from Abd al-A'la.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20250