Making magic feel dangerous involves making it mysterious and unpredictable. Conceptually, I've wanted to do that for nearly thirty years, and I've experimented with a wide variety of mechanics.
What I've discovered is that mysterious and unpredictable magic is not really suitable for table top play unless you also are going to make magic super rare, because it imposes too many burdens on the DM.
Magic in D&D is the province of the player. The spells have always been a part of the PH, even back in the day when DMG's had warnings on them that they shouldn't be read by players. The spells are thus inherently known and not mysterious, and to a large extent selected and controlled by the players. The players may occasionally run into magic in a dungeon which is dangerous and mysterious, and Gygax was very much a believer in magical weirdness in dungeons, but their own magic is not numinous to them.
This has an incredibly positive benefit on play. Whenever a player wants to cast a spell, it's up to the player to bring the mechanics of the spell into play and resolve them. The DM basically has no mental or mechanical burden when spells are used. If spells are to be numinous and dangerous, the mental and mechanical burden falls to the DM.
The same is largely true of magic items in the possession of the players.
Because of this, if you want to make spells or magic items "dangerous", you also have to greatly limit their availability and ubiquity in the game because dangerous magic imposes such a high mental burden on the DM that you won't be able to keep track of it all otherwise, and such a high mechanical burden on play that whenever magic is used it will slow resolution down to a crawl. Casting a spell becomes an event which draws all the focus of play onto the spell-caster. Thus, you can't have all that spotlight being accrued to the one player all the time, and so you can't have him casting spells all the time.
If you want magic to be super rare, all this is fine. But don't expect it to feel very much like D&D. Likewise, if you had some sort of computer program that was keeping track of the hidden information and the mechanical resolution for you, this would work, but you can't easily do it on a table top.