If the target permanent is an illegal target by the time Kefnet’s Last Word resolves, the entire spell doesn’t resolve. Your lands will untap during your next untap step as normal.

Artwork
Loading artwork…
Kefnet's Last Word
Hour of Devastation · #39 · EN
Nonfoil—Foil—
Card rules
Gain control of target artifact, creature, or enchantment. Lands you control don't untap during your next untap step.
In his final moments, Kefnet reached into the minds of those around him, desperate for logic within the consuming chaos.
Rare · Illustrated by Clint Cearley
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
No lands that you control will untap during your next untap step, even lands that aren’t tapped as this spell resolves. This includes lands that enter the battlefield after this spell resolves.
In a multiplayer game, if a player leaves the game, all cards that player owns leave as well, and any effects that give the player control of permanents immediately end.
The control-change effect of Kefnet’s Last Word lasts indefinitely. It doesn’t wear off during the cleanup step.
If more than one spell says that lands you control don’t untap during your next untap step, the effects will all wear off during that untap step. You’ll untap lands you control during your untap step after that one.
Gaining control of a creature doesn’t cause you to gain control of any Auras or Equipment attached to it. They’ll remain attached, but an Aura’s effect that affects “you” still affects its controller rather than you, the controller of an Equipment can move it during their next main phase, and so on.