If the target spell is an illegal target as Counterpoint tries to resolve, it won’t resolve and none of its effects will happen.

Artwork
Loading artwork…
Counterpoint
Murders at Karlov Manor Commander · #41 · EN
Nonfoil—Foil—
Card rules
Counter target spell. You may cast a creature, instant, sorcery, or planeswalker spell from your graveyard with mana value less than or equal to that spell's mana value without paying its mana cost.
"Nice theory, but I'm going to have to poke some holes in it."
Rare · Illustrated by Brian Valeza
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
Alternatively, if the target spell is still a legal target but can’t be countered, Counterpoint will still resolve and allow you to cast a spell from your graveyard with mana value less than or equal to the target spell’s mana value.
If you cast a spell “without paying its mana cost,” you can’t choose to cast it for any alternative costs. You can, however, pay additional costs, such as kicker costs. If the card has any mandatory additional costs, those must be paid to cast the spell.
You cast the card from your graveyard as Counterpoint resolves. You can’t wait to cast it later in the turn. Timing restrictions based on the card’s types are ignored.
If a spell you cast has X in its mana cost, you must choose 0 as the value of X when casting it without paying its mana cost.
If the target spell has X in its mana cost, use the value chosen for X when determining that spell’s mana value.