While I, like many fans, am often frustrated by Marvel's refusal to let a character named Magik do magic, I do believe there is an in-character explanation for this most of the time, that also explains why she was said to not be able to do magic on earth back in the 80s.
In my opinion, Illyana was always lying about her powers not working on earth, because she was afraid to use them. There were simply too many times when she did use spells on earth for it to be otherwise. It was too inconsistent.
In the issue where she joins the New Mutants, she could have cast spells that reduced S'ym to dust, and did cast at least 3 different spells, an energy blast, mystic chains, and rewriting Stevie's memories, all on earth.
Something important to note is when fighting S'ym, she notes how good it feels to use her magic, something which I believe factored into her decision to stop using said magic not long afterward.
In the following issue, she casts a spell to send her astral form to check on Kitty, and it is this going wrong that causes everyone to realize she's a witch. If her spells did not work on earth, they would never have found out her secret and this issue wouldn't have happened.
She continues to cast spells on earth during the following story, the Demon Bear Saga, where she casts protective wards around Dani's operating room on earth.
Her explanation for not using spells when fighting the Demon Bear is not that her spells won't work, but that she did not have 'time to be fancy,' meaning spellcasting in the heat of battle would take too long. This is also the moment her armor first appeared.
The next issue, we get the first mention of her sorcery being limited on earth, something that had never been hinted at beforehand, but which would be mostly the standard going forward.
What I believe happened is that the unexpected appearance of her armor so soon after she began using spells regularly on earth frightened her, as did her enjoyment of her spellcasting. So she came up with the lie that her spells didn't work on earth as an excuse to stop using them. And she would continue to use spells on earth sporadically despite claiming that she couldn't do any spells, such as when she reclaimed her power after the Beyonder took it away.
When all the heroes' memories were overwritten by Kulan Gath, she had no objection that her powers didn't work when Captain America ordered jer to cast a cloaking spell on earth. She did it without problem.
During the Mutant Massacre, she claimed she needed to go to Limbo to heal Kitty, but a few issues later, she was more honest about the real reason she couldn't, because of her inner darkness, the cure could be worse than the disease. She also cast a spell in her room.
What we see is someone who could cast spells and use magic on earth, but refuses to because she is afraid of that power. This is probably what Dr. Strange meant when he said he had little to teach her and what she needed was the growth of her spirit.
To some extent, this fear has remained even as she has gained true control over her powers. Since her return in 2007, no one has said her powers don't work on earth, but she still prefers not to use them if she doesn't have to. But she can if the need arises.
If Realm of X had a point, it was to finally reconcile Illyana to her identity and power as a sorceress, overcoming those fears. This is why it is so disappointing to see her getting 'serious' represented by er using a gun, something that is comparatively meaningless.
What I would like to see is an exploration of how her newfound character development affects how she acts in battle, and perhaps a reflection on all the fights she could have won and tragedies she could have stopped had she not been deliberately holding herself back.