If a Game Object becomes untargetable for a spell or ability after becoming its target and before it resolves, the spell or ability will mistarget on resolution. Any instructions related to that Game Object will be ignored as the spell resolves.
§ 758.1 Core Rules PDF (officieel)
§ 758 Untargetable Game Objects are not legal targets for the indicated spells and abilities. See rule 355.6. Targeting for more information.