إِنَّمَا نَحْنُ فِتْنَةٌ فَلَا تَكْفُرْ
We are only a test, so do not disbelieve. (Al-Baqarah 2:102)
This warning identifies the episode involving magic as a trial, not an invitation to unbelief. Explaining the existence or danger of a practice is not identical to endorsing its use. A warning and a subsequent wrongful choice belong to different levels of responsibility.
More generally, serving as an intermediary in a situation does not automatically imply approving another person's misuse of it. This distinction alone, however, does not decide every legal ruling concerning magic; the relevant scriptural evidence and conditions still matter.