Well, I guess you have some good luck.
She may have dropped from the ceiling of the enclosure or got stuck on something, who knows, unless you saw it happen?
I have had a few mantids that have molted fine from that type of lid as well. They just chose to molt from that, despite the other things that I fastened in there for them. <_< I have also had things go wrong with containers that were modified for gripping.
When a mantis begins a molt, they are obviously hanging upside down with their feet and tarsal claws.
That soon changes to an empty piece of skin supporting the weight of the mantis. It can hold on pretty well, but I think that it is more likely to slip if the claws of the skin aren't sunk in to something securely.
I try to limit the opportunity for the insect to make a bad choice by fastening textured things to the places that the insect is most likely to be, whether it is molting, climbing, or just hanging around.