Because Ghastly Demise isn't put into your graveyard until it's finished resolving, it won't be counted when determining whether the creature is destroyed.

Artwork
Loading artwork…
Ghastly Demise
Commander Legends · #129 · EN
Nonfoil—Foil—
Card rules
Destroy target nonblack creature if its toughness is less than or equal to the number of cards in your graveyard.
"Anyone can snap her fingers and yank a soul. I prefer to kill creatively." —Braids, dementia summoner
Common · Illustrated by Gary Ruddell
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Penny Legal
PreDH Legal
Premodern Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Old School Not Legal
Pioneer Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
Ghastly Demise can target any nonblack creature. Compare the creature's toughness to the number of cards in your graveyard as Ghastly Demise resolves to see if that creature is destroyed.