Bad moulting most of the time, is the result of lack of humidity. Many species require a high humidity, which helps to ease the skins when they shed. If a mantis is a young nymph, and looses a leg, or part of the leg, it can grow back, as the mantis matures. However, if the mantis is L5+, then it will more than likely fail to grow back.
Bad shedding can sometimes result in more than the loss of a leg. They can come out twisted in their skins, and sometimes, dead.
Species that require a low humidity, but still have problems shedding, include species such as the Indian Rose Mantis (Gongylus Gongyloides) and depending how you are keeping them, the Giant Devils Flower Mantis (Idolomantis Diabolica).
If you are aware that your mantis will shed its skin shortly, then you must ensure that there is no livefood loose in the enclosue. A lot of livefood, crickets especially will eat the mantis, and the mantis is especially vulnerable, just after it has shed its skin, when it is very soft, and slightly moist.