Program: 171561
Project: 171561
Buggy source:
private boolean recursiveMove(EntityCoupleableRollingStock parent,int tickOffset){
  if (this.positions.size() < tickOffset) {
    System.out.println("String_Node_Str" + tickOffset);
    return true;
  }
  TickPos currentPos=this.positions.get(tickOffset - 1);
  TickPos parentPos=parent.positions.get(tickOffset);
  boolean onTrack=!currentPos.isOffTrack;
  if (tickOffset == 1) {
    this.positions=new ArrayList<TickPos>();
    this.positions.add(currentPos);
  }
  CouplerType coupler=this.getCouplerFor(parent);
  CouplerType otherCoupler=parent.getCouplerFor(this);
  if (coupler == null) {
    parent.decouple(this);
    this.decouple(parent);
    this.triggerResimulate();
    System.out.println("String_Node_Str");
    return true;
  }
  if ((!this.isCouplerEngaged(coupler) || !parent.isCouplerEngaged(otherCoupler)) && tickOffset < parent.positions.size() - 1) {
    double prevDist=currentPos.position.distanceTo(parentPos.position);
    double dist=currentPos.position.distanceTo(parent.positions.get(tickOffset + 1).position);
    if (prevDist <= dist) {
      System.out.println("String_Node_Str");
      return true;
    }
    System.out.println("String_Node_Str");
  }
  Vec3d myOffset=this.getCouplerPositionTo(coupler,currentPos,parentPos);
  Vec3d otherOffset=parent.getCouplerPositionTo(otherCoupler,parentPos,currentPos);
  if (otherOffset == null) {
    if (!world.isRemote) {
      ImmersiveRailroading.logger.warn(String.format("String_Node_Str",this.getPersistentID(),parent.getPersistentID()));
    }
    return true;
  }
  double distance=myOffset.distanceTo(otherOffset);
  Vec3d nextPosForward=myOffset.add(VecUtil.fromYaw(distance,currentPos.rotationYaw));
  Vec3d nextPosReverse=myOffset.add(VecUtil.fromYaw(-distance,currentPos.rotationYaw));
  if (otherOffset.distanceTo(nextPosForward) > otherOffset.distanceTo(nextPosReverse)) {
    distance=-distance;
  }
  TickPos nextPos=this.moveRollingStock(distance,currentPos.tickID);
  this.positions.add(nextPos);
  if (nextPos.isOffTrack) {
    onTrack=false;
  }
  if (nextPos.speed.metric() != 0) {
    ChunkManager.flagEntityPos(this.world,new BlockPos(nextPos.position));
    for (    CouplerType toChunk : CouplerType.values()) {
      ChunkManager.flagEntityPos(this.world,new BlockPos(this.getCouplerPosition(toChunk)));
    }
  }
  for (  CouplerType nextCoupler : CouplerType.values()) {
    EntityCoupleableRollingStock coupled=this.getCoupled(nextCoupler);
    if (coupled == null || coupled == parent) {
      continue;
    }
    onTrack=coupled.recursiveMove(this,tickOffset) ? onTrack : false;
  }
  return onTrack;
}

Fixed version (ground truth):
private boolean recursiveMove(EntityCoupleableRollingStock parent,int tickOffset){
  if (this.positions.size() < tickOffset) {
    System.out.println("String_Node_Str" + tickOffset);
    return true;
  }
  TickPos currentPos=this.positions.get(tickOffset - 1);
  TickPos parentPos=parent.positions.get(tickOffset);
  boolean onTrack=!currentPos.isOffTrack;
  if (tickOffset == 1) {
    this.positions=new ArrayList<TickPos>();
    this.positions.add(currentPos);
  }
  CouplerType coupler=this.getCouplerFor(parent);
  CouplerType otherCoupler=parent.getCouplerFor(this);
  if (coupler == null) {
    parent.decouple(this);
    this.decouple(parent);
    this.triggerResimulate();
    System.out.println("String_Node_Str");
    return true;
  }
  if ((!this.isCouplerEngaged(coupler) || !parent.isCouplerEngaged(otherCoupler)) && tickOffset < parent.positions.size() - 1) {
    double prevDist=currentPos.position.distanceTo(parentPos.position);
    double dist=currentPos.position.distanceTo(parent.positions.get(tickOffset + 1).position);
    if (prevDist <= dist) {
      System.out.println("String_Node_Str");
      return true;
    }
    System.out.println("String_Node_Str");
  }
  Vec3d myOffset=this.getCouplerPositionTo(coupler,currentPos,parentPos);
  Vec3d otherOffset=parent.getCouplerPositionTo(otherCoupler,parentPos,currentPos);
  if (otherOffset == null) {
    if (!world.isRemote) {
      ImmersiveRailroading.logger.warn(String.format("String_Node_Str",this.getPersistentID(),parent.getPersistentID()));
    }
    return true;
  }
  double distance=myOffset.distanceTo(otherOffset);
  Vec3d nextPosForward=myOffset.add(VecUtil.fromYaw(distance,currentPos.rotationYaw));
  Vec3d nextPosReverse=myOffset.add(VecUtil.fromYaw(-distance,currentPos.rotationYaw));
  if (otherOffset.distanceTo(nextPosForward) > otherOffset.distanceTo(nextPosReverse)) {
    distance=-distance;
  }
  TickPos nextPos=this.moveRollingStock(distance,currentPos.tickID);
  this.positions.add(nextPos);
  if (nextPos.isOffTrack) {
    onTrack=false;
  }
  if (nextPos.speed.metric() != 0) {
    ChunkManager.flagEntityPos(this.world,new BlockPos(nextPos.position));
    for (    CouplerType toChunk : CouplerType.values()) {
      ChunkManager.flagEntityPos(this.world,new BlockPos(this.getCouplerPosition(toChunk,nextPos)));
    }
  }
  for (  CouplerType nextCoupler : CouplerType.values()) {
    EntityCoupleableRollingStock coupled=this.getCoupled(nextCoupler);
    if (coupled == null || coupled == parent) {
      continue;
    }
    onTrack=coupled.recursiveMove(this,tickOffset) ? onTrack : false;
  }
  return onTrack;
}