I can reproduce in 1.18.2. Here are some more specific steps to reproduce:
Place three rails in an east-west direction such that the east rail is one block higher than the middle rail and the west rail is one block lower than the middle rail. All three rails should be connected.
Place a fourth rail to the north or south of the middle rail at a height of either one block below, one block above, or the same as the middle rail.
Expected result: the first three rails remain connected.
Actual result: the middle rail appears to connect to the fourth rail and the east rail.
This does not occur if the west rail is at the same height as the middle rail.
I can reproduce in 1.18.2. Here are some more specific steps to reproduce:
Place three rails in an east-west direction such that the east rail is one block higher than the middle rail and the west rail is one block lower than the middle rail. All three rails should be connected.
Place a fourth rail to the north or south of the middle rail at a height of either one block below, one block above, or the same as the middle rail.
Expected result: the first three rails remain connected.
Actual result: the middle rail appears to connect to the fourth rail and the east rail.
This does not occur if the west rail is at the same height as the middle rail.
See the 12_30 attachments.