Program: 164293
Project: 164293
Buggy source:
private static void rareEffect(final Wand wand,final Hero user,final Ballistica bolt){
switch (Random.Int(4)) {
case 0:
    cursedFX(user,bolt,new Callback(){
      public void call(){
        Char ch=Actor.findChar(bolt.collisionPos);
        if (ch != null && ch != user) {
          Sheep sheep=new Sheep();
          sheep.lifespan=10;
          sheep.pos=ch.pos;
          ch.sprite.killAndErase();
          Actor.remove(ch);
          Dungeon.level.mobs.remove(ch);
          HealthIndicator.instance.target(null);
          GameScene.add(sheep);
          CellEmitter.get(sheep.pos).burst(Speck.factory(Speck.WOOL),4);
        }
 else {
          GLog.i("String_Node_Str");
        }
        wand.wandUsed();
      }
    }
);
  break;
case 1:
KindOfWeapon weapon=user.belongings.weapon;
Armor armor=user.belongings.armor;
KindofMisc misc1=user.belongings.misc1;
KindofMisc misc2=user.belongings.misc2;
if (weapon != null) weapon.cursed=weapon.cursedKnown=true;
if (armor != null) armor.cursed=armor.cursedKnown=true;
if (misc1 != null) misc1.cursed=misc1.cursedKnown=true;
if (misc2 != null) misc2.cursed=misc2.cursedKnown=true;
EquipableItem.equipCursed(user);
GLog.n("String_Node_Str");
wand.wandUsed();
break;
case 2:
if (Dungeon.depth > 1 && !Dungeon.bossLevel()) {
Buff buff=Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
if (buff != null) buff.detach();
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) if (mob instanceof DriedRose.GhostHero) mob.destroy();
InterlevelScene.mode=InterlevelScene.Mode.RETURN;
InterlevelScene.returnDepth=Random.Int(Dungeon.depth - 1) + 1;
InterlevelScene.returnPos=-1;
Game.switchScene(InterlevelScene.class);
}
 else {
ScrollOfTeleportation.teleportHero(user);
wand.wandUsed();
}
break;
case 3:
new SummoningTrap().set(user.pos).activate();
wand.wandUsed();
break;
}
}

Fixed version (ground truth):
private static void rareEffect(final Wand wand,final Hero user,final Ballistica bolt){
switch (Random.Int(4)) {
case 0:
    cursedFX(user,bolt,new Callback(){
      public void call(){
        Char ch=Actor.findChar(bolt.collisionPos);
        if (ch != null && ch != user) {
          Sheep sheep=new Sheep();
          sheep.lifespan=10;
          sheep.pos=ch.pos;
          ch.destroy();
          ch.sprite.killAndErase();
          Dungeon.level.mobs.remove(ch);
          HealthIndicator.instance.target(null);
          GameScene.add(sheep);
          CellEmitter.get(sheep.pos).burst(Speck.factory(Speck.WOOL),4);
        }
 else {
          GLog.i("String_Node_Str");
        }
        wand.wandUsed();
      }
    }
);
  break;
case 1:
KindOfWeapon weapon=user.belongings.weapon;
Armor armor=user.belongings.armor;
KindofMisc misc1=user.belongings.misc1;
KindofMisc misc2=user.belongings.misc2;
if (weapon != null) weapon.cursed=weapon.cursedKnown=true;
if (armor != null) armor.cursed=armor.cursedKnown=true;
if (misc1 != null) misc1.cursed=misc1.cursedKnown=true;
if (misc2 != null) misc2.cursed=misc2.cursedKnown=true;
EquipableItem.equipCursed(user);
GLog.n("String_Node_Str");
wand.wandUsed();
break;
case 2:
if (Dungeon.depth > 1 && !Dungeon.bossLevel()) {
Buff buff=Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
if (buff != null) buff.detach();
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) if (mob instanceof DriedRose.GhostHero) mob.destroy();
InterlevelScene.mode=InterlevelScene.Mode.RETURN;
InterlevelScene.returnDepth=Random.Int(Dungeon.depth - 1) + 1;
InterlevelScene.returnPos=-1;
Game.switchScene(InterlevelScene.class);
}
 else {
ScrollOfTeleportation.teleportHero(user);
wand.wandUsed();
}
break;
case 3:
new SummoningTrap().set(user.pos).activate();
wand.wandUsed();
break;
}
}