It got out because the new shell is still kind of soft and leathery at that point. They don't harden up for a few days after they molt, so the crab is extra bendy until it does. Our local zoo had a display of molted sea creature shells...rather creepy looking, but fascinating.