There's a bug in the calculation of the distance between a point and the plane of a G4ErrorPlaneSurfaceTarget Line 151-2 of geometry/management/src/G4ErrorPlaneSurfaceTarget.cc currently reads: G4double alpha = std::acos( vec * normal() / vec.mag() / normal().mag() ); G4double dist = std::fabs(vec.mag() * std::cos( alpha )); This causes a problem if vec and normal are the same (or very nearly the same), since occasionally this division returns (1 + epsilon) due to the available precision. In this scenario, acos returns nan and the distance is nan, which means we step right over our target plane. It's actually a curious way to calculate a distance between a point and plane anyway (to take the acos of an angle and calculate cos of it). It can just be: G4double dist = std::fabs(vec*normal() / normal().mag()); which avoids the nan problem.
Solved, thanks for spotting this