I too went through something similar to yourself.
I subsequently found that I was very sensitive to medication (both Metformin and Simvastatin). Eventually I weaned myself off Met replacing it with a very low carb diet, lots of raw or steamed green veg and nuts in my diet (I've become a bit slack with this of late and again seem to be losing weight, but not as dramatically as before - need to get back on track!!)
I also discovered a very unpleasant tasting Indian vegetable called karela which helped stabilise my levels and could be used in place of small doses of met.
Once your levels start to stablise and you decrease your meds (especially Met which has a known weight loss effect), then your weight might start to go back up - like mine did. Physical training helps, but you may need to get your levels lower (without meds that is) before you get the energy to get back into serious physical stuff.
In the meanwhile - take half hour (or longer) walks after meals, this helped me no end!
It's weird but what I've realised is that for some of us, the condition works as if to strip our body of fat and muscle to feed/fuel itself, hence the weightloss. I found eating carbs causes me to lose weight quite dramatically still. When I low carbed very rigourously, I had my best weight gain, when I got slack in that department I started to lose weight again.
But be careful not to take my case as general, all of our bodies react differently, so figure out your own personal idiosyncrasies and work around them. You may want to invest in heavy testing and recording (e.g 1 and 2 hour after meals, 2 x a day) for say 4 months (if you can afford) to make yourself more familiar with what food keeps your levels down and those that bring them up.
Hope this helps - if only in some small measure.