If the target creature or planeswalker is an illegal target when Pyretic Rebirth tries to resolve, you'll still return the target artifact or creature card from your graveyard to your hand.

Artwork
Loading artwork…
Pyretic Rebirth
Modern Horizons 3 · #200 · EN
Nonfoil—Foil—
Card rules
Return target artifact or creature card from your graveyard to your hand. Pyretic Rebirth deals damage equal to that card's mana value to up to one target creature or planeswalker.
Death has never kept Darigaaz down for long.
Uncommon · Illustrated by Richard Kane Ferguson
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
If the target card in your graveyard is an illegal target when Pyretic Rebirth tries to resolve, no damage will be dealt.