If an instant or sorcery card you cast this way is countered, it will still be exiled.

Artwork
Loading artwork…
Diluvian Primordial
Outlaws of Thunder Junction Commander · #96 · EN
Nonfoil—Foil—
Card rules
Flying
When this creature enters, for each opponent, you may cast up to one target instant or sorcery card from that player's graveyard without paying its mana cost. If a spell cast this way would be put into a graveyard, exile it instead.
5/5
Rare · Illustrated by Stephan Martiniere
Format legality
Commander Legal
Duel Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Pioneer Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander 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
If an instant or sorcery card you cast this way goes to a zone other than exile or a graveyard, perhaps because one of its abilities says to put it into its owner's hand, it won't be exiled. This is true even if the card would be put into a graveyard later that turn.
If a card has X in its mana cost, you must choose 0 as its value.
If you cast an instant or sorcery spell with cipher this way, you may exile the card encoded on a creature you control. If you can't, or if you choose not to, the card will end up exiled but not encoded on a creature.
You can choose a number of targets up to the number of opponents you have, one target per opponent.
When casting an instant or sorcery card this way, ignore timing restrictions based on the card's type. Other timing restrictions, such as "Cast [this card] only during combat," must be followed.
You cast the cards one at a time, choosing modes, targets and so on. The last card you cast will be the first one to resolve.
If you can't cast one of the target instant or sorcery cards, perhaps because there are no legal targets available, or if you choose not to cast one, it will remain in its owner's graveyard.
If you cast a card "without paying its mana cost," you can't pay alternative costs such as overload costs. You can pay additional costs such as kicker costs. If the card has mandatory additional costs, you must pay those.