On the final yāʾ of الْقَاضِي, pronouncing ḍamma or kasra is considered heavy (thiqal); grammarians therefore treat them as estimated.
A fatḥa is lighter, so the accusative is pronounced الْقَاضِيَ, with fatḥa on the final yāʾ.
Important: heaviness (thiqal) is not the same as the impossibility (taʿadhdhur) discussed with maqṣūr.