Program: 171576
Project: 171576
Buggy source:
private void recursiveMove(EntityCoupleableRollingStock prev){
  ChunkManager.flagEntityPos(this);
  for (  CouplerType coupler : CouplerType.values()) {
    EntityCoupleableRollingStock coupled=this.getCoupled(coupler);
    if (coupled == null || coupled == prev) {
      continue;
    }
    setCoupled(coupler,coupled);
    Vec3d myOffset=this.getCouplerPositionTo(coupler,coupled);
    Vec3d otherOffset=null;
    for (    CouplerType otherCoupler : CouplerType.values()) {
      EntityCoupleableRollingStock otherStock=coupled.getCoupled(otherCoupler);
      if (otherStock != null && otherStock.getPersistentID().equals(this.getPersistentID())) {
        otherOffset=coupled.getCouplerPositionTo(otherCoupler,this);
      }
    }
    if (otherOffset == null) {
      ImmersiveRailroading.logger.warn(String.format("String_Node_Str",this.getPersistentID(),coupled.getPersistentID()));
switch (coupler) {
case FRONT:
        if (coupledFrontMissingTick == -1) {
          coupledFrontMissingTick=this.ticksExisted;
        }
 else         if (coupledFrontMissingTick + 60 < this.ticksExisted) {
          this.decouple(coupler);
        }
      break;
case BACK:
    if (coupledBackMissingTick == -1) {
      coupledBackMissingTick=this.ticksExisted;
    }
 else     if (coupledBackMissingTick + 60 < this.ticksExisted) {
      this.decouple(coupler);
    }
  break;
}
if (!world.isRemote) {
System.out.println(coupled == findByUUID(coupled.getPersistentID()));
System.out.println(coupled.getCoupled(CouplerType.FRONT));
System.out.println(coupled.getCoupledUUID(CouplerType.FRONT));
System.out.println(coupled.getCoupled(CouplerType.BACK));
System.out.println(coupled.getCoupledUUID(CouplerType.BACK));
}
continue;
}
 else {
switch (coupler) {
case FRONT:
coupledFrontMissingTick=-1;
case BACK:
coupledBackMissingTick=-1;
break;
}
}
double distance=myOffset.distanceTo(otherOffset);
Vec3d nextPosForward=otherOffset.add(VecUtil.fromYaw(distance,coupled.rotationYaw));
Vec3d nextPosReverse=otherOffset.add(VecUtil.fromYaw(-distance,coupled.rotationYaw));
if (myOffset.distanceTo(nextPosForward) > myOffset.distanceTo(nextPosReverse)) {
distance=-distance;
}
coupled.moveRollingStock(distance);
coupled.recursiveMove(this);
}
}

Fixed version (ground truth):
private void recursiveMove(EntityCoupleableRollingStock prev){
  ChunkManager.flagEntityPos(this);
  for (  CouplerType coupler : CouplerType.values()) {
    EntityCoupleableRollingStock coupled=this.getCoupled(coupler);
    if (coupled == null || coupled == prev) {
      continue;
    }
    setCoupled(coupler,coupled);
    Vec3d myOffset=this.getCouplerPositionTo(coupler,coupled);
    Vec3d otherOffset=null;
    for (    CouplerType otherCoupler : CouplerType.values()) {
      EntityCoupleableRollingStock otherStock=coupled.getCoupled(otherCoupler);
      if (otherStock != null && otherStock.getPersistentID().equals(this.getPersistentID())) {
        otherOffset=coupled.getCouplerPositionTo(otherCoupler,this);
      }
    }
    if (otherOffset == null) {
      if (!world.isRemote) {
        ImmersiveRailroading.logger.warn(String.format("String_Node_Str",this.getPersistentID(),coupled.getPersistentID()));
switch (coupler) {
case FRONT:
          if (coupledFrontMissingTick == -1) {
            coupledFrontMissingTick=this.ticksExisted;
          }
 else           if (coupledFrontMissingTick + 60 < this.ticksExisted) {
            this.decouple(coupler);
          }
        break;
case BACK:
      if (coupledBackMissingTick == -1) {
        coupledBackMissingTick=this.ticksExisted;
      }
 else       if (coupledBackMissingTick + 60 < this.ticksExisted) {
        this.decouple(coupler);
      }
    break;
}
System.out.println(coupled == findByUUID(coupled.getPersistentID()));
System.out.println(coupled.getCoupled(CouplerType.FRONT));
System.out.println(coupled.getCoupledUUID(CouplerType.FRONT));
System.out.println(coupled.getCoupled(CouplerType.BACK));
System.out.println(coupled.getCoupledUUID(CouplerType.BACK));
}
continue;
}
 else {
switch (coupler) {
case FRONT:
coupledFrontMissingTick=-1;
case BACK:
coupledBackMissingTick=-1;
break;
}
}
double distance=myOffset.distanceTo(otherOffset);
Vec3d nextPosForward=otherOffset.add(VecUtil.fromYaw(distance,coupled.rotationYaw));
Vec3d nextPosReverse=otherOffset.add(VecUtil.fromYaw(-distance,coupled.rotationYaw));
if (myOffset.distanceTo(nextPosForward) > myOffset.distanceTo(nextPosReverse)) {
distance=-distance;
}
coupled.moveRollingStock(distance);
coupled.recursiveMove(this);
}
}