The Problem
The problem that you had is because of the cave underground / near the mob farm. Why superflat world worked? Simply because there is no cave under / below it.
Why?
Why is it? It's because when a mob want to spawn, the game simply search for a random location with certain requirement needed. In this situation is Light Level.
How to fix it
Well simply enough, you must make the light level of near by caves up. You can see the block you're standing light level by entering the Debug Menu by pressing F3. Make sure there is no near by cave to have light level of 7 or below. Make sure also there is no cave with light level 7 or below in 64 block from the middle of the farm.
Since you are talking about 128 blocks, I'd assume you're already familiar with the spawning rules, but for others finding this topic, hostile mobs which are further than 128 blocks from a player will rapidly despawn, even though they can spawn anywhere in a 240x240 square from each player. There is also a cap on the total number of mobs which can be spawned at once, which means that if you have many people in different locations you may hit the cap, reducing the grinder's efficiency.
What this means for you is that the important thing isn't so much where your mob grinder is, but rather where the person running it is standing, and where others on the server might be causing mobs to spawn without being killed. To deal with the first, make sure that there are no legal spawn points outside your grinder within 128 blocks of where a person would be standing that would be "running" the grinder. Placing that person at y-level 128 would mean that you need to light up all caves underground, so a safer choice is to put their standing point at around ground level y + 128. You can also completely clear a 128 block square in the ground and build your grinder inside, if you want, or any other combination of tactics that results in no viable space being available for mob spawns within 128 blocks of the player that are not in your grinder. An ocean would partly solve this, since hostile mobs can't spawn in the actual ocean, but the caves underneath would still have to be dealt with or be out of range.
To combat the second, there is only so much you can do. On a private server with only a few people, you shouldn't hit the mob cap, but on a public server the only thing you can do is try to prevent mobs from spawning around players in your base. Generally, this means lighting all caves in the immediate area around your base, and possibly the ground as well if you want to maintain efficiency overnight.
Note that all of the above doesn't actually matter that much for basic mob grinders, since most of their inefficiency comes from having to wait for mobs to actually enter the killzone through random pathing, or through actually being killed by a player. It starts to become noticeable with grinder designs that actively kill the mobs as they spawn.
I should also note that I assume that you mean a mob grinder when you say a spawner - if you actually mean a monster spawner, the strategy becomes quite different since they have very different spawning rules from regular mob spawning.
Best Answer
Two issues are at odds here:
Mob cap and despawn sphere. Any mobs more than 128 blocks from any player will despawn immediately, meaning if you build your farm in such a way the only spawnable blocks within 128 from you are the spawn spaces of your farm, all the spawn attempts that succeed are within your farm and it works fine - if you allow even a small number of spawn spaces outside your farm (unlit caves), they will quickly fill up with mobs, which will only despawn slowly, filling up mob cap, and your farm will produce an absolute pittance of drops. So, "building high" is a decent solution to this problem.
Spawn attempt success chance. To spawn a mob, the game first picks a random x, z coords around the player, then randomly selects the y coordinate (altitude) between y=0 and the highest non-air block in given (x,z) column. If that block is spawnable, and other preconditions (light level, mob cap, biome, enough room to fit the mob) are satisfied, the spawn succeeds. Obviously if your farm is, say, 10 spawning floors located with top-most block at y=100, the chance the randomly selected block is one of these spawning floors is twice that of your farm ending at y=200 - the latter has twice as many non-spawnable spaces of empty air underneath the farm. That means farms built high have significantly lower rates than farms built low - in particular, the state-of-the-art EOL mob farm has between 1 and 2 blocks of height, and its rates are plain incredible.
Now if you are building a farm just for the mob drops, the solution is pretty simple: Build your farm low above the ground, or even partially in the ground, create your AFK platform slightly less than 127 blocks above the lowest block where mobs of your farm can be (usually the kill platform) and spawnproofing the bit of terrain that is included within the sliver of despawn sphere that intersects the ground, if any - if the ground is at y=63-64, your afk spot at y=200, and the kill platform of your farm at y=75, you're fine. Note: build the afk platform slightly to the side, not to overlay any of it directly over the spawn platforms of the farm, that way you're not cutting into the spawn rates by increasing the farm height needlessly.
The problem is if you want XP or use looting to increase drops - the mobs must be brought to you. At that point you have the choice of building your farm really high, so that the mobs fall down to a chamber in front of your afking spot, which obviously cuts into the farm's rates as described previously - or you deliver the mobs from the "low" farm using mechanics like bubblevators, which take their sweet time - as result the number of mobs alive at any given time increases and you're likely to hit the mob cap - farm ceasing spawning as new mobs are brought. Or you can go the ambitious route and either light up, or outright remove all potential spawning spaces outside your farm while building it as low as possible. (just note: mobs don't spawn within a sphere of 24 blocks from the player, so take this into account.)
Generally, if you want my opinion on the matter, the option of building the farm low, afk spot high is the best reward:effort ratio, and there are better XP solutions than a mob grinder.