The spell has no visible effect, e.g. a ray or glow running from the caster to the target, right? Which means the only way the caster would know the spell didn't resolve properly is if the actual casting got messed up or interrupted somehow.
Same as when a demon or whatever has magic resistance that applies before any save: the caster has no way of knowing which effect blocked the spell from working, only that it didn't work.
I guess we see the fiction differently: I see this as the spell tries to affect the target but the target shrugs it off, with or without even knowing something was trying to affect it.
Which, when neither you nor the target can see or hear the bear trap, makes no appreciable difference.