You're missing the point. "Science" isn't something that excludes magic, and magic doesn't escape science.

Science is a process. You can easily have "magical" and "non-magical" things, just as we have in the real world "electrical" and "non-electrical" technology. "Magic" is just some set of things which operate using rules that are part of that...magic. Whether it's "magic energy" that enables things otherwise impossible, or something else entirely.

If magic defies scientific inquiry, that means it is highly inconsistent. You can do the same thing 11 times and come up with so many different results that you couldn't begin to even do statistics on them. At which point, magic isn't something you can "do."

The moment magic is something one can "do," it becomes subject to meaningful scientific study, as you can document it, do experiments, and at least get a probabilistic sense for how things will go.