DnD magic is a poor example of personal/spiritual magic, though – it’s way too predictable, divinity-as-tech, insert prayer A in slot B to achieve effect C. You were closer above: magic that relies on convincing personal or quasi-personal cosmic forces to do something for you is at its core not science, it’s business or politics, a contest of wills or the art of wheedling something out of someone. The science-ish bit, e.g. how many mushrooms you pop to meet a spirit, is incidental, a necessary but not remotely sufficient part of the art.
I’m writing a magic-as-tech series myself – and I agree that science and wonder are 100% compatible – but I love mythopoeic fiction too, and definitely don’t think that the only way to write magic is as a system of rules allowing predictable technological effects. Magic (personal or impersonal) can be imagined as a point where we’re immersed in and/or grapple with the unmeasurable, unpredictable, and incalculable aspects of existence – with things inherently beyond our power to quantify or control. Trying to boil a magic system like this down to a science is like trying to do the same to aesthetics, or ethics, or mysticism; with all respect to those who’ve tried, the result is a failed reductionism.
To immerse oneself in the glorious, incomprehensible marrow of the universe is not an experience to be abandoned because it’s unsafe.