If the creature isn't a legal target as Gild tries to resolve, the spell won't resolve and none of its effects will happen. No token will be created.

Artwork
Loading artwork…
Gild
Commander 2015 · #127 · EN
Nonfoil—Foil—
Card rules
Exile target creature. Create a Gold token. (It's an artifact with "Sacrifice this token: Add one mana of any color.")
Merchants of the Underworld trade in coins of clay. Gold serves another purpose.
Rare · Illustrated by Richard Wright
Format legality
Commander Legal
Duel Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Pioneer Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
You will control the token, no matter who controls the target creature.