Often when baking potatoes if you wrap them in aluminum foil, they will become gummy due to the moisture inside. Another common reason is that you have overmixed the filling. That is why you should simply mash the potatoes lightly with the ingredients before scooping them into the shell. Beating or using a mixer will result in gummy potatoes.