Im not sure what the problem is but I know that my Molly have donr this in the past. I got them and then about a week later a couple of them started to "wiggle" as you say. What I did was bought a test kit and checked the water. I changed out about 50% of the water and cleanned out the filter and vacummed the gravel. Then when I put more water in i added a little bit extra(not too much extra) of the water dechlorinater. Like just a drop extra. Then I made sure that they were fed the right things and rearranged the decorations. Pretty much, one of the things I did solved the problem. I imagine that it had something to do with the water or the tank itself. Something wasnt right. But they havent done it since. Try doing a good clean up and see if that helps. Molly are pretty hardy, atleast mine are and I have never lost one. I have had two of mine for almost two years.
Good Luck,
Janell
ps. Maybe try looking up molly diseases and see what you come up with.