If you choose not to cast the card, it is put on the bottom of its owner's library in a random order along with the other exiled cards.

Artwork
Loading artwork…
Gríma, Saruman's Footman
Tales of Middle-earth Commander · #57 · EN
Nonfoil—Foil—
Card rules
Gríma can't be blocked.
Whenever Gríma deals combat damage to a player, that player exiles cards from the top of their library until they exile an instant or sorcery card. You may cast that card without paying its mana cost. Then that player puts the exiled cards that weren't cast this way on the bottom of their library in a random order.
1/4
Rare · Illustrated by Matt Stewart
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Oathbreaker Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future 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
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
If that player exiles their entire library without exiling an instant or sorcery card, they will randomize the order of the exiled cards, and the cards then become that player's library, ending the effect. They will not continue to exile and randomize their library forever.
If you cast a spell "without paying its mana cost," you can't pay any alternative costs. You can, however, pay additional costs, such as kicker costs. If the card has any mandatory additional costs, you must pay those.
You cast the card while the ability is resolving and still on the stack. You can't wait to cast it later in the turn.
If the 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.
The cards are exiled face up. All players will be able to see them.