Nether Portal Linking for nether Roof and bottom Nether

Pretty simple: if x and z coordinates are matching (what you wrote - they are) - then the portals will link to the closer portal.

Your bedrock level portal is somewhere around y=4, upper strata of bottom bedrock, your overworld top portal is at y=64, 2 blocks above sea level. Your Nether top portal is at y=129, a block above the ceiling.

Distance from the ceiling: abs(64-129) = 65. Distance from the bottom: abs(64-4) = 60. So your upper portal links to the closer one - the one at y=4. Raise your upper portal by some 3 blocks and it will work.