Honestly, "magic is ambient nanotech that's poorly understood and difficult to invoke" is a rather tired trope, because it's an instantly obvious approach one can take. Doesn't stop people from re-using it over and over, take e.g. "The Lord of the Ice Garden" by Grzędowicz: this twist is so obvious that all the build-up feels kinda insulting to the reader's intelligence.
Right, but I don't think that it necessarily needs to be a twist.
The first two Pillars of Eternity games leaned hard into this trope, but it was never really "revealed" as a plot point -- it was just background that you uncovered as you progressed stepwise through the game. The Gods as literal hiveminds, chained to or unbound from their original core functions to varying degrees; a fallen hyper-technological society; stuff like that...
I've never liked it as a narrative element because it's such a handwave. If you're going to have "magic is nanotech", or whatever other backing, at least actually use that backing to put narrative rules on it that the reader can understand.