If the target creature is an illegal target by the time Chain to Memory tries to resolve, the spell won’t resolve. You won’t scry 2.

Artwork
Loading artwork…
Chain to Memory
Theros Beyond Death · #46 · EN
Nonfoil—Foil—
Card rules
Target creature gets -4/-0 until end of turn. Scry 2.
Those who do not learn from their mistakes are bound to relive them.
Common · Illustrated by Paul Scott Canavan
Format legality
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
Timeless Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Penny Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions