You may cast Hazel's Nocturne with no targets just to have each opponent lose 2 life and you gain 2 life. However, if you do choose any targets, and all those targets are illegal as Hazel's Nocturne tries to resolve, it won't resolve and none of its effects will happen. No player will lose or gain life.

Artwork
Loading artwork…
Hazel's Nocturne
Bloomburrow · #97 · EN
Nonfoil—Foil—
Card rules
Return up to two target creature cards from your graveyard to your hand. Each opponent loses 2 life and you gain 2 life.
On stormy autumn days, the leaves in the trees chitter and whisper.
Uncommon · Illustrated by Dominik Mayer
Format legality
Alchemy Legal
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pioneer Legal
Standard Legal
Standard Brawl Legal
Timeless Legal
Vintage Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
PreDH Not Legal
Premodern Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions