Simulation freezes after a few events

I have a pretty simple simulation of a crystal generating cerenkov light placed inside a world air volume.

In my detector construction I have defined the optical properties of my volumes as follows:

//World
G4MaterialPropertiesTable *mptWorld = new G4MaterialPropertiesTable();
mptWorld->AddProperty("RINDEX", energy, rindexWorld, energy_size);
worldMat->SetMaterialPropertiesTable(mptWorld);

//Crystal
G4MaterialPropertiesTable *mptPbF2 = new G4MaterialPropertiesTable();
mptPbF2->AddProperty("RINDEX", energy, rindexPbF2, energy_size);
mptPbF2->AddProperty("ABSLENGTH", energy, absorptionPbF2, energy_size);
PbF2->SetMaterialPropertiesTable(mptPbF2);

The values for the energy, absorptionscoeffiecients and such come from a table I read in but that does not matter here.

In addition I defined some border properties of the crystal, e.g. I wrap it in teflon:

G4OpticalSurface* opCrystalSurface = new G4OpticalSurface("crystalSurface");
opCrystalSurface->SetType(dielectric_LUT);
opCrystalSurface->SetFinish(polishedteflonair);
opCrystalSurface->SetModel(LUT);
opCrystalSurface->SetPolish(0.8);

And then I create the border surface

G4LogicalBorderSurface* CrystalSurface = new G4LogicalBorderSurface("CrystalSurface", crystalPhysical, worldPhysical, opCrystalSurface);

I pass the crystal before the world volume since the cerenkov photons come from the crystal.
Now in principle the simulation works fine but when running it in batch mode with a few thousand events it freezes after a while. Funnily when switching the order:

G4LogicalBorderSurface* CrystalSurface = new G4LogicalBorderSurface("CrystalSurface", worldPhysical, crystalPhysical, opCrystalSurface);

it runs without any issues. But of course this is nonsensical for my purpose.
I tried adding Absorption properties to the world volume but that did not help.
I read that everlasting photons might pose a problem sometimes but i cannot see where this might happen in my simulation.

Any ideas or tips on how to investigate the problem in more detail?

EDIT:
Ok i just double checked and it also freezes when changing the order. So in the end it is some random thing happening.

EDIT2:
I further narrowed it down. The setting of the optical properties seems to be a problem:

//World
G4MaterialPropertiesTable *mptWorld = new G4MaterialPropertiesTable();
mptWorld->AddProperty("RINDEX", energy, rindexWorld, energy_size);
worldMat->SetMaterialPropertiesTable(mptWorld);

//Crystal
G4MaterialPropertiesTable *mptPbF2 = new G4MaterialPropertiesTable();
mptPbF2->AddProperty("RINDEX", energy, rindexPbF2, energy_size);
mptPbF2->AddProperty("ABSLENGTH", energy, absorptionPbF2, energy_size);
PbF2->SetMaterialPropertiesTable(mptPbF2);

As I said, the values for energy etc. come from a table in a file I read in. There are around 500 values for each energy from 0.5eV to 5eV, hence the values might be very close together. When taking only every 10th element the simulation (as of now) seems to run. Is it plausible that many values close together could be a problem?