For clarification, this problem occurred both before and after a magma forge was placed. There were no screw pumps involved.
The magma tube idea might be something. There was a magma tube about 10 tiles away diagonally, and while there was not a direct connection, the Magma Flow under that *was* at a higher z level than the rock shelf the forge was built inside of.
The magma came and went kind of like tides, and I eventually managed to make an anvil when the "tide" was low to build another forge elsewhere.
I've seen what you're describing before, in many other versions, even without a magma tube. For me, it happens when the embark isn't completely, 100%, flat.
What happens is, if any magma anywhere on the embark is higher than or at the same level as your forge, you'll see this ebb-and-flow of magma trying to fluid-level itself out.
You've already found a solution, and that is to find a spot that is just above the highest point of magma
across the entire embark.
Of course, other solutions like minecart-dumping a single tile of 7/7 magma up to the surface is always another option for almost any embark. When you find what you've found, that ends up being pretty safe, because you can build the pickup-magma part of the minecart circuit pretty easily with constructed walls, adjacent magma and a magma safe floodgate/lever.
The root cause? IIRC, It appears to be that the embark surface Z-level disparities/differences, if they are part of a biome edge/change, can cause both the SMR sea and the resulting magma above it to have different Z levels as well. It's typically only 1 or 2 Z-levels off, from what I've seen.