If the target is illegal as Grapple with Death tries to resolve, it won't resolve and none of its effects will happen. You won't gain life.

Artwork
Loading artwork…
Grapple with Death
Secrets of Strixhaven · #192 · EN
Nonfoil—Foil—
Card rules
Destroy target artifact or creature. You gain 1 life.
Not until Lluwen watched Professor Fel in action did he truly understand just how closely life and death were intertwined.
Common · Illustrated by Nereida
Format legality
Alchemy Legal
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Future Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Pioneer Legal
Standard Legal
Standard Brawl Legal
Timeless Legal
Tlr Legal
Vintage Legal
Old School Not Legal
Penny Not Legal
PreDH Not Legal
Premodern Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions