I don't see any phantom variables.
When does MD make the phantom variables?
You mention saving a macro in one version and opening it in a newer version - is this the only way phantom variables are generated?
For the above example does it generate phantom variables on every macro or only a few?
Is it just global variables or doe it include local variables?
Do macros saved in 5.49.12, deleted in 5.49.12 and then imported into 5.49.12 generate phantom variables?
Firstly I have noticed this when updated from 5.49.13 to 5.51.3. One macro has become doing wrong, I've seen the new errors in log that the phantom string variable is wrong, while in the text of the macro was the proper variable. Right variable in macro, the different in log. Surprise of the updating.
I started to manage. I have seen that phantoms, deleted and saved (still in 5.53.3). Then deleted all in MD and reloaded that saving. All the phantoms were back at the places. I tried to load saving that done in 5.49.13 - 5.53.3 opened it with the bugs too. I have installed 5.49.12 and it could open saving in 5.49.13 without any phantoms. While 5.49.13 did open its own saving with the phantoms!
So, I can say that 5.49.12 is the last ver to open normally its savings.
Now I have changed smth to make that macro run as it must, in log I cannot see these errors, but 2 phantoms I cannot delete out of the savings in 5.49.13 and +. They are not used but appear after loading MDR, even if I delete them before.
I recall that many time I have a similar problem with one variable that isnt in any macro anymore but couldnt be deleted. It had appeared every time I deleted. Immortal

Even when it seemed to be done successfully, later it appears again. Finally I began not to pay attention on it, but its worth to be deleted.