You can cast Toll the Dead on anything. it just does nothing if it is an invalid target.
This is how I would deal with it:
Casts Toll the Dead on a chest. [fake roll] "Your spell has no effect on the chest."
Casts Toll the Dead on a Mimic. [hidden save succeeds] "Your spell has no effect on the chest."
Casts Toll the Dead on a Mimic. [hidden save fails] "the chest squeals in pain, roll for initiative."
Shoots an arrow at a mimic. [attack roll hits] "the chest squeals in pain, roll for initiative."