هَذَا is commonly an indeclinable demonstrative; its syntax is described by case position.
الْعَصَا is an inflected maqṣūr noun; its case is described by an estimated vowel.
الْقَاضِي is not maqṣūr; it is a manqūṣ noun, discussed in the following class.
Principle: Identify both the morphological noun type and its role in the sentence.