Yeah, absolutely if it's been established to the players (and without good justification for a pit suddenly moving, which, in a fantasy RPG can certainly exist).What do you mean by "established"? If it has somehow been established with the players, the sure, I agree with you.
But what if it hasn't? Is there a difference between:
a) The GM has drawn the trap on a map that the players can't see
b) The GM hasn't drawn it on the map, but has decided where it is
c) The GM has decided there is a trap, but not where it is
d) The GM decides mid-fight that a trap would be cool
In the first two examples the location of the trap has been established, but not to the players. f this is all hidden from thm, why is there a difference between any of these four scenarios?
Those four cases lie between full world simulation, where things are set down in advance and not changed, and full freeform play where you add things as you go along (so long as you don't contradict it once it's in play). Different people and groups, and systems, have different preferences—and some have partisan positions!—about that. So any of abcd could be totally fine for a given group.
There are players who will demand to see the GM's map if they suspect any fudging of the world (and GMs who would or would not "cheat" in that way). There are players that are cool with it.