So it's more about predestination and knowledge of future timelines... has been done many times before as well of course, but can be interesting.
What I would always prefer (but that's just my personal preference) is if it's based on actual SciFi, not magic, as in, the dreams the MC has are not some supernatural phenomenon.
Actually, the Recursion novel by Blake Crouch I mentioned kind of has that element... where people suddenly remember certain things about the future (or a different timeline) and there it's all about changing events so the apocalypse can be prevented.