Program: 158769
Project: 158769
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Spell spell=game.getStack().getSpell(targetPointer.getFirst(game,source));
  if (spell == null) {
    spell=(Spell)game.getLastKnownInformation(targetPointer.getFirst(game,source),Zone.STACK);
  }
  Player controller=game.getPlayer(source.getControllerId());
  if (spell != null && controller != null) {
    Target usedTarget=null;
    for (    Target target : spell.getSpellAbility().getTargets()) {
      if (target.getFirstTarget().equals(source.getSourceId())) {
        usedTarget=target.copy();
        usedTarget.clearChosen();
      }
    }
    if (usedTarget == null) {
      return false;
    }
    for (    Permanent creature : game.getState().getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(),source.getControllerId(),game)) {
      if (!creature.getId().equals(source.getSourceId()) && usedTarget.canTarget(source.getControllerId(),creature.getId(),source,game)) {
        Spell copy=spell.copySpell();
        for (        Target target : spell.getSpellAbility().getTargets()) {
          if (target.getClass().equals(usedTarget.getClass()) && target.getMessage().equals(usedTarget.getMessage())) {
            target.clearChosen();
            target.add(creature.getId(),game);
            break;
          }
        }
        copy.setControllerId(source.getControllerId());
        copy.setCopiedSpell(true);
        game.getStack().push(copy);
        String activateMessage=copy.getActivatedMessage(game);
        if (activateMessage.startsWith("String_Node_Str")) {
          activateMessage=activateMessage.substring(6);
        }
        if (!game.isSimulation()) {
          game.informPlayers(controller.getLogName() + activateMessage);
        }
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Spell spell=game.getStack().getSpell(targetPointer.getFirst(game,source));
  if (spell == null) {
    spell=(Spell)game.getLastKnownInformation(targetPointer.getFirst(game,source),Zone.STACK);
  }
  Player controller=game.getPlayer(source.getControllerId());
  if (spell != null && controller != null) {
    Target usedTarget=null;
    setUsedTarget:     for (    UUID modeId : spell.getSpellAbility().getModes().getSelectedModes()) {
      spell.getSpellAbility().getModes().setActiveMode(modeId);
      for (      Target target : spell.getSpellAbility().getTargets()) {
        if (target.getFirstTarget().equals(source.getSourceId())) {
          usedTarget=target.copy();
          usedTarget.clearChosen();
          break setUsedTarget;
        }
      }
    }
    if (usedTarget == null) {
      return false;
    }
    for (    Permanent creature : game.getState().getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(),source.getControllerId(),game)) {
      if (!creature.getId().equals(source.getSourceId()) && usedTarget.canTarget(source.getControllerId(),creature.getId(),source,game)) {
        Spell copy=spell.copySpell();
        setTarget:         for (        UUID modeId : spell.getSpellAbility().getModes().getSelectedModes()) {
          copy.getSpellAbility().getModes().setActiveMode(modeId);
          for (          Target target : copy.getSpellAbility().getTargets()) {
            if (target.getClass().equals(usedTarget.getClass()) && target.getMessage().equals(usedTarget.getMessage())) {
              target.clearChosen();
              target.add(creature.getId(),game);
              break setTarget;
            }
          }
        }
        copy.setControllerId(source.getControllerId());
        copy.setCopiedSpell(true);
        game.getStack().push(copy);
        String activateMessage=copy.getActivatedMessage(game);
        if (activateMessage.startsWith("String_Node_Str")) {
          activateMessage=activateMessage.substring(6);
        }
        if (!game.isSimulation()) {
          game.informPlayers(controller.getLogName() + activateMessage);
        }
      }
    }
    return true;
  }
  return false;
}