Weight gain is about more than incoming and outgoing calories. Many other factors have an influence on weight gain and weight maintenance. Thyroid dysfunction, insulin resistance, insomnia or improper sleep habits, improper dietary habits like skipping meals, stress and high cortisol levels all contribute to weight gain. Theoretically, you could have a wonderfully balanced diet but if you are not sleeping, have hormonal imbalances, or are very stressed out the likely hood of you losing weight is slim.