Tricking the players is I think different than moving the goalposts in play.
What goalposts? If we are going to be using sports analogies, then we probably need to talk about how having the referee also being the captain of the opposing team with no accountability or budget cap as to the content of the opposition is intrinsically unfair and a conflict of interest.
But, if we don't have that conversation, we still are not specifically talking about the GM changing details of something the PCs have already engaged in.
You turn a corner, and there's a goblin. What difference does it make if that goblin was written down three weeks ago, or the GM got an idea for a cool goblin encounter just a moment ago?
A player being deceived can in theory see through the deception, provided the DM is sticking to their prep and treating it as established fact in the setting, whether the players are aware of it or not.
I mean, yeah, tell that to the player who was not told of the existence of rot grubs after their first encounter with them. Player's gotten hammered before for not trying to seek information before engaging. Tries to play smart, puts an ear to a door before entering, and their character dies. Totally fair, that.
Early D&D and its modules are full of that sort of thing.