You're welcome. It is not entirely surprising.. If the variable a is not initialized then it is the empty string ( "" ).. So $a becomes $"" .
Some awks may interpret it in a numerical context and change it to 0 and so it turns into $0 (which is the record), which would give the proper answer, but it would work differently from what you might expect...
Other awks may not accept $"" and raise an error message
Yet other awks may assign it to $0 (because it is a numerical context), but reference $"" which may return 0, etc...
It is an ambiguous situation and it really depends on the specific awk implementation how this improper use of the variable gets handled..