OK, I am to busy to give a long detailed response, but will chime in as time allows with individual thoughts and experiences.
Suggestion #1: Have an AD&D mindset (a).
What I mean by this is AD&D made epic encounters work by "nerfing" casters. High level monsters had magic resistance* that could complete shut down direct magical effects. This forced casters to work more strategically. They could still be effective, but rarely, IME, complete change the encounter themselves. Additionally, encounters often had effects the nullified or reduced the effectiveness of magic. You can do this in 5e too.
I realize this might not be a popular option, but I have seen it work in both AD&D and 5e. Though I don't think this should be an every encounter solution, but a sometimes solution.
*In AD&D magic resistance was more akin to 5e's magic immunity. Spells would simply fail to have any effect on the monster.