The shortcut doesn’t see into the dictionary which is why you type the key. The content of the dictionary key value pairs can be dynamically modified or even inferred.
When the IF comes to reference the key value pair, it doesn’t know what type of data it is supposed to be. As a result it has the most limited of checks.
When you first pull the value into a particular data type such as a text action or number action, you are effectively casting the data into a particular data type and at that point Shortcuts is able to assign a wider range of conditions to check for.
From a technical perspective, this is good. From a practical perspective, the option to specify the data type on the retrieval of the value would remove the need for the additional ‘casting’ step.