When for some reason, it really wouldn't work if a player is doing a certain thing, I think the only right way to deal with it is to tell the player that this will just not work for reasons about the prepared material, and that the character can not actually do the action on question. The player must make a different decision and the character do something else.
While this limits the player's freedom to decide what the character does, it still remains the player's choice what actually happens and what the character thinks, says, and does. It's not making character decisions for the player, and it also doesn't snatch away the outcome of a plan that the player already invested work in.

Just tell players "sorry, you reached one of the invisible fences". That's a bit disappointing for them for the next two minutes, but it doesn't interfere with the roles and responsibilities of everyone involved in the game.