If the target permanent is an illegal target as Lost in Space tries to resolve, it won’t resolve and none of its effects will happen. You won’t surveil.

Artwork
Loading artwork…
Lost in Space
Edge of Eternities · #62 · EN
Nonfoil—Foil—
Card rules
Target artifact or creature'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.)
Every so often, the Edge reminds you that there's always more to discover.
Common · Illustrated by Allen Panakal
Format legality
Alchemy Legal
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Future Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Penny Legal
Pioneer Legal
Standard Legal
Standard Brawl Legal
Timeless Legal
Vintage Legal
Old School 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