I plugged your code into one of my optical sims to check, and your issue should be property names, as mentioned in Different results when using Geant4 version 11 for optical simulation material property names were changed between 10.7 and 11. Swap out FASTCOMPONENT for SCINTILLATIONCOMPONENT1, YIELDRATIO for SCINTILLATIONYIELD1, and FASTTIMECONSTANT for SCINTILLATIONTIMECONSTANT1 and you should be good to go.