Had the same problem with Nullius wind turbines. Solved by adding checks to ignore the "airspace collision" entities to this segment:
if placing_ghost then
local found_entities = underground_surface.find_entities( { pipe_entity_definition.position, pipe_entity_definition.position } )
for _,found_entity in pairs(found_entities) do
if found_entity.type ~= "tile-ghost" and found_entity.name ~= "nullius-wind-collision"
and found_entity.name ~= "nullius-wind-collision-vertical" and found_entity.name ~= "nullius-wind-collision-horizontal" then
-- bail out because there's already something where we'd place a ghost
return
end
end
end
Probably the same thing is going on with elevated rails, where it does not ignore entities that the pipe wouldn't collide with. You can add the same check for them to your local version until someone posts the proper fix for this.