If the target nonland permanent is an illegal target when Vanish from Sight tries to resolve, it won't resolve and none of its effects will happen. You won't surveil.

Artwork
Loading artwork…
Vanish from Sight
Duskmourn: House of Horror · #82 · EN
Nonfoil—Foil—
Card rules
Target nonland permanent's owner puts it on their choice of the top or bottom of their library. Surveil 1. (Look at the top card of your library. You may put it into your graveyard.)
The Wanderer flung out her hand, but too late—Kaito had vanished into the House's maw.
Common · Illustrated by Billy Christian
Format legality
Alchemy Legal
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Pioneer Legal
Standard Legal
Standard Brawl Legal
Timeless Legal
Vintage Legal
Future Not Legal
Old School Not Legal
Penny Not Legal
PreDH Not Legal
Premodern Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions