Unable to Print Detector index

in this case that could be the same bug as in the linked post. try filtering also for IsFirstStepInVolume, as suggested in Multiple Steps on geometricBoundary