If each target card is an illegal target as Wildest Dreams resolves, Wildest Dreams doesn't resolve and is put into its owner's graveyard. It's not exiled.

Artwork
Loading artwork…
Wildest Dreams
Kaladesh · #174 · EN
Nonfoil—Foil—
Card rules
Return X target cards from your graveyard to your hand. Exile Wildest Dreams.
"I opened my mind to the immensity of the wonders around me. It was only then that I could see the Great Conduit." —Rashmi, aether-seer
Rare · Illustrated by Daniel Ljunggren
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Pioneer Legal
Timeless Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions