If the target artifact or enchantment is an illegal target by the time Invoke the Divine tries to resolve, the spell doesn’t resolve. You won’t gain any life.

Artwork
Loading artwork…
Invoke the Divine
Foundations Commander · #36 · EN
Nonfoil—Foil—
Card rules
Destroy target artifact or enchantment. You gain 4 life.
"Let's see how brave you really are behind all that oak and steel."
Common · Illustrated by Campbell White
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Penny Legal
Pioneer Legal
Timeless Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
If the target artifact or enchantment is an illegal target as Invoke the Divine tries to resolve, it won’t resolve and none of its effects will happen. You won’t gain 4 life.