Sure, but let's say that the spell cast was actually Misdirected Rope Trick Blender. This spell hides the caster and makes an illusory version of them climb a rope trick that leads into a magical blender of force (like a Blade Barrier), which activates one round after a creature enters the space.
I think it's quite relevant to ask whether ALL of those enemies would have climbed the "rope trick" had the rope trick actually been this other spell. If they would have, no foul (though the talk of a "woodshed" does concern me a bit). Otherwise, most definitely a foul on the DM's part, IMO, since they were clearly metagaming in order to punish the player.