You may experience seeing a dead larva on surface of substrate (and sometimes inside under substrate). A cause of death cannot easily be determined. Here we are illustrating a general appearance of dead scarab larvae.
Image 1: Strategus aloeus L3 Larvae. From Left to Right, (1) an alive, (2) a freshly dead (1 Day), and (3) a dead larva (been a while).
Image 2: Strategus aloeus L3 Larvae. a freshly dead larva (Left) and a dead larva for a while (Right).
When larva dies, they slowly change their color to black as time passes by. Couple tips to prevent death would be: keep substrate clean, and pest-free; have enough ventilation holes (generally, for scarab larvae, couple of 1mm holes are enough, but if it is too humid, more is better); remove any fungal activities, etc.