You don't have to choose a target for Proctor's Gaze. However, if you do and the target is illegal as Proctor's Gaze tries to resolve, it won't resolve and none of its effects will happen. You won't search your library.

Artwork
Loading artwork…
Proctor's Gaze
Secrets of Strixhaven · #213 · EN
Nonfoil—Foil—
Card rules
Return up to one target nonland permanent to its owner's hand. Search your library for a basic land card, put it onto the battlefield tapped, then shuffle.
Only proctors are allowed to use magic in exam halls, enabling them to more easily catch cheaters in the act.
Uncommon · Illustrated by Danny Schwartz
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
Pioneer Legal
Standard Legal
Standard Brawl Legal
Timeless Legal
Vintage Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander 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