(This is also happening in bedrock edition)
The spawners only appear beforehand if you make a copy of the world and once you try to go to that location in survival (original world) it the spawner doesn't generate.
(This is also happening in bedrock edition)