Further to this, you have (hopefully) been restoring weight by eating a normal diet, with the addition of supplements for the weight gain. The actual food that you are digesting is not what is making you gain weight: the supplements are.