If you're not working out, that's part of it. How much are you cutting your calories? If you cut them too much, your metabolism will slow even more.
You should see your doctor and have her/him do some simple tests to make sure your thyroid is functioning properly. The tests you need are Free T3, Free T4 and TSH - don't let them get by with just a TSH test, as that's not enough and doesn't tell the whole story. If your thyroid is under active, your metabolism also slows down and losing weight becomes, seemingly, impossible.
Both, sudden, unexplained weight gain and depression are prime symptoms of under active thyroid.
You're probably not doing anything wrong. Sometimes you gain some muscle when you start working out. Give your routine a couple months (like two months of a strict routine) and if you still don't see a difference, see a doctor.