It seems like very few people here care about Star Trek being scientifically accurate.
For Trek, I think a lot of people care more about sufficiently leveled/rounded, engaging stories - with likable characters that might end up making mistakes (after characters being properly established), and the occasional questionable one (side character, villain, main character if done right, etc).
It's an element or compound that hasn't been discovered or invented yet. In my thinking, those are both natural substances - we have elements and compounds in real life - and haven't discovered them all yet. Magic entails the supernatural; things that do not exist in nature, and never can. So even if dilithium is non-existent, it can be still be intended as a fictional natural phenomena, just as Sherlock Holmes is a fictional natural character.
To put it another way: If something was magic, simply because it was made up, any device that does not exist in fiction, including genres like the detective novel, or spy novel, would be magic.
Science knows of lithium, it's not inconceivable there's dilithium as a natural (not synthetic, since Trek discusses the direct mining for it) phenomenon. It's a stretch but is closer to fiction than fantasy.
Transporters? What we know of science rules out teleportation as being plausible, so they're magic. Trek itself hasn't been consistent in any theoretical or cartoonish science going behind the how of the process. Yes, like wi-fi the waves can go through other matter. What ruins the idea is that the matter is converted to energy (read: destroyed) and then rebuilt at the other end. And if people wanted to discuss who the clone is they'd watch the 1970s sci-fi spoof "Quark". However, real life teleportation is still debated - good luck to those finding how to make it work on a scale that allows complex organisms to move like that without being killed.
Tricorders and other multipurpose scanning devices are real - just not quite as amazing.
Warp speed might be possible. But to get to another planet in a reasonable time... never mind Einstein's theory of relativity: The faster you move through space, the slower you move through time. What you're moving away from isn't slowing down temporally. Or so the theory goes, it's not been proven or disproved yet.
Now Korob's magic wand... that's just hocus pocus. And yet people often accept various accuracy/realism problems. Which suggests there's a bigger question that has less to do with the level of science accuracy that laymen know at any given time for any given work of fiction, and more to do with the being pulled and buying into the fictional universe and cultivation of suspension of disbelief. Or lack thereof. And that's when things get so complex that even Einstein would be baffled.