The molting process starts weeks or even months (in large animals) before the actual ecdysis (shedding of the old molt skin). The must lay down an entire new molt skin underneath the old one. (You can sometimes see the setae of the antennal scales growing into the antennal scales. They grow inside out and at the time of the molt pressure causes them to "pop out" much like the fingers of a rubber glove that is inside out and you blow into it.) As the molt nears, mineras are withdrawn from the old cuticle and stored in glands in the body. You can sometimes see these as while glands in each segment of the thorax and abdomen along the ventral lateral surface. Closer still to the molt, the old cuticle begins to raise up and a fluid filled space opens between the old and new cuticle. A few hours before the molt, suture lines begin to weaken. You can see these as lines on the dorsal mid-line of the thoracic segments. They run completely across the tergite plates. When it is time to molt, the animal increases fluid in the body (osmotic change) and violently contracts its body muscles to greatly increase internal pressure. This causes the thoracic tergites to split and the animals body is forced into the newly created opening. The animal is now in a jack-knife position working its way out of the old molt skin back first. It is sort of like a breach birth and any loss of hydrostatic pressure or muscular contraction will stop the process and the animal will become stuck and die. Note that during this time the gills are not functioning well until they pull free and are exposed to water. Once free, the animal is so soft that the muscles have nothing to work against except each other and initial movement is by hydostatic pressure changes. However, within minutes the new cutlicle begins to "tan" and harden and over the next few days minerals will be added to harden the cuticle to its old functional stiffness. Until that happens, the animal cannot strike and if it tries, it will literally tear the appendage apart.
I won't go into all the things that can and do go wrong, but I think you can see that this is the weak link in the stomatopod's life cycle and a typical gonodactylid will have to do this 25-35 times. Most stomatopods that are not eaten or badly wounded die during the molt simply because of the energetic demands that potential for physical malfunctions.
When we keep stomatopods in an aquarium, we often see them die during a molt and assume that something is terribly wrong. It may not be. Like all organisms, stomatopods die and typically death comes during a molt.
Roy