Program: 171574
Project: 171574
Buggy source:
private void recursiveMove(EntityCoupleableRollingStock prev){
  TickPos lastPos=this.getCurrentTickPos();
  this.positions=new ArrayList<TickPos>();
  this.positions.add(lastPos);
  for (  TickPos parentPos : prev.positions) {
    CouplerType coupler=this.getCouplerFor(prev);
    Vec3d myOffset=this.getCouplerPositionTo(coupler,lastPos,parentPos);
    CouplerType otherCoupler=prev.getCouplerFor(this);
    Vec3d otherOffset=prev.getCouplerPositionTo(otherCoupler,parentPos,lastPos);
    if (otherOffset == null) {
      if (!world.isRemote) {
        ImmersiveRailroading.logger.warn(String.format("String_Node_Str",this.getPersistentID(),prev.getPersistentID()));
      }
      continue;
    }
    double distance=myOffset.distanceTo(otherOffset);
    Vec3d nextPosForward=myOffset.add(VecUtil.fromYaw(distance,lastPos.rotationYaw));
    Vec3d nextPosReverse=myOffset.add(VecUtil.fromYaw(-distance,lastPos.rotationYaw));
    if (otherOffset.distanceTo(nextPosForward) > otherOffset.distanceTo(nextPosReverse)) {
      distance=-distance;
    }
    lastPos=this.moveRollingStock(distance,lastPos.tickID);
    this.positions.add(lastPos);
    if (lastPos.speed.metric() != 0) {
      ChunkManager.flagEntityPos(this.world,new BlockPos(lastPos.position));
      for (      CouplerType toChunk : CouplerType.values()) {
        ChunkManager.flagEntityPos(this.world,new BlockPos(this.getCouplerPosition(toChunk)));
      }
    }
  }
  this.sendToObserving(new MRSSyncPacket(this,this.positions));
  for (  CouplerType coupler : CouplerType.values()) {
    EntityCoupleableRollingStock coupled=this.getCoupled(coupler);
    if (coupled == null || coupled == prev) {
      continue;
    }
    coupled.recursiveMove(this);
  }
}

Fixed version (ground truth):
private void recursiveMove(EntityCoupleableRollingStock prev){
  TickPos lastPos=this.getCurrentTickPos();
  this.positions=new ArrayList<TickPos>();
  this.positions.add(lastPos);
  for (  TickPos parentPos : prev.positions) {
    CouplerType coupler=this.getCouplerFor(prev);
    if (coupler == null) {
      prev.decouple(this);
      this.decouple(prev);
      return;
    }
    Vec3d myOffset=this.getCouplerPositionTo(coupler,lastPos,parentPos);
    CouplerType otherCoupler=prev.getCouplerFor(this);
    Vec3d otherOffset=prev.getCouplerPositionTo(otherCoupler,parentPos,lastPos);
    if (otherOffset == null) {
      if (!world.isRemote) {
        ImmersiveRailroading.logger.warn(String.format("String_Node_Str",this.getPersistentID(),prev.getPersistentID()));
      }
      continue;
    }
    double distance=myOffset.distanceTo(otherOffset);
    Vec3d nextPosForward=myOffset.add(VecUtil.fromYaw(distance,lastPos.rotationYaw));
    Vec3d nextPosReverse=myOffset.add(VecUtil.fromYaw(-distance,lastPos.rotationYaw));
    if (otherOffset.distanceTo(nextPosForward) > otherOffset.distanceTo(nextPosReverse)) {
      distance=-distance;
    }
    lastPos=this.moveRollingStock(distance,lastPos.tickID);
    this.positions.add(lastPos);
    if (lastPos.speed.metric() != 0) {
      ChunkManager.flagEntityPos(this.world,new BlockPos(lastPos.position));
      for (      CouplerType toChunk : CouplerType.values()) {
        ChunkManager.flagEntityPos(this.world,new BlockPos(this.getCouplerPosition(toChunk)));
      }
    }
  }
  this.sendToObserving(new MRSSyncPacket(this,this.positions));
  for (  CouplerType coupler : CouplerType.values()) {
    EntityCoupleableRollingStock coupled=this.getCoupled(coupler);
    if (coupled == null || coupled == prev) {
      continue;
    }
    coupled.recursiveMove(this);
  }
}