In الْقَاضِي, the final yāʾ belongs to the structure of the noun itself; the form meets the definition of manqūṣ.
In غُلَامِي, the yāʾ is a separate first-person possessive pronoun; the noun is غُلَام. Its three case vowels were estimated in the preceding lesson.
Conclusion: Similar endings need not have the same grammatical explanation.