This behavior is due to the fact that your variable never had a data type assigned to it while hte fields and scattered variables doi have a data type assigned to them. Try this one;
zz = 0
zz = NULL
?str(zz)
No error because the data type of zz has been set to numeric so the STR() function works.