Undiagnosed diabetes can cause weight gain as it often leads to elevated blood sugar levels, which can promote fat storage and increased appetite. However, weight gain is just one potential symptom of undiagnosed diabetes, and other factors may also contribute to changes in weight.