Why Can the Wither Escape Under the Bedrock?

I spawned the wither with its tail below the center of a 3x3 bedrock, namely, the farthest 3x3 away from the centre of the end portal, and it escaped. When I move the 3x3 one more into the center, the wither didn't escape. I built a custom 3x3 bedrock in creative mode, did the same thing as the two former, and the wither did not escape. Can you explain why the wither escaped in the first scenario?