This is essentially a duplicate of
a:=%5%??77 will not throw. There is no difference between
%"nonexistentvariablename"% and
%"any invalid variable name"%, by design. It is not valid to dynamically reference a variable which does not exist, regardless of whether the name you are passing would be valid for a variable. No variable exists with the given name, therefore the right branch of ?? is used.
If %Expr% was to differentiate between valid and invalid variable names, it would throw an error for
%"o.key"% because this is not a valid variable name. I do not think that is what you are expecting or wanting to happen.
The documentation states that
%Expr% is "dereference" or "name substitution", where "the value of the sub-expression
Expr is used as the name or partial name of a variable
or property." You might have interpreted it to mean that
Expr can be a string like "o.key", but that is not what it means. An example of valid use is
o.%"key"% - i.e.
Expr provides the
name of the property. "o.key" is not the name of the property, but an arbitrary expression. If the operator was capable of evaluating arbitrary expressions within a string, it would be the "arbitrary expression evaluator", not "name substitution".
o.key ?? "default" is valid in v2.1-alpha.2+. The documentation for v2.0 states that the left operand of ?? must be a variable, which
o.key is not.