I went ahead and looked into what the mod was doing differently (the version on github is old pre-space-age so I just decompressed their current version). I found out the issue was you were just simply missing an underground_collision_mask (https://lua-api.factorio.com/latest/types/CollisionMaskConnector.html) field on your underground connections (I also removed the override for the vanilla pipe-to-ground by changing the for loop as it's unneeded to override the vanilla pipe now).
The documentation states this field is optional (https://lua-api.factorio.com/latest/types/PipeConnectionDefinition.html#underground_collision_mask), but it's needed for space-age (In order to connect, both ends must have the same collision mask specified). This would explain why your fix partially worked, this field is set when space-age loads. Switching the connections just broke space age from modifying the underground connection since it's setting the mask only for pipe_connections[2] which in turn indirectly happened to fix the issue since it forced vanilla pipes to not have any mask matching the lack of mask on your connections.
space-age/base-data-updates.lua:26:
data.raw["pipe-to-ground"]["pipe-to-ground"].fluid_box.pipe_connections[2].underground_collision_mask = underground_collision_mask
https://pastebin.com/xxCsabbf