If the target nonland permanent is an illegal target by the time Winds of Rebuke resolves, the entire spell doesn’t resolve. No player loses cards from the top of their library.

Artwork
Loading artwork…
Winds of Rebuke
Amonkhet · #76 · EN
Nonfoil—Foil—
Card rules
Return target nonland permanent to its owner's hand. Each player mills two cards.
"I have foreseen that you will not pass my trial."
Common · Illustrated by Mathias Kollros
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Pioneer Legal
Timeless Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Penny 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