It is very hard to guess what may be wrong with your molly. We need more specifics like water paramters, tankmates, your maintenance routine, and maybe a brief history of your tank.
Was your molly fine prior to giving birth? Did she display any symptoms prior to giving birth? Female mollies can be quite volatile just prior to giving birth, and any kind of trauma can result in stillbirth, which seems to be what happened in your case, if I had to guess. I have discovered that it is best to move the molly to her own tank or breeding trap well in advance of the birth because if you try it just before she is due, the resulting trauma and stress can result in stillborns.
The imbalance in swimming can also be attributed to an air bladder condition. I'm not sure what sort of medications on the market would treat this condition though.
Keep an eye on your molly and monitor her symptoms and see if her condition improves over the next few days.