Looks like your road connections are moving along the axis of the river. In the above examples it seems like it is an attempt to avoid a marsh tile (but it can also happen while avoiding forest tiles) on the opposite side of and adjacent to the river.
