The obesity-health saga is an interesting example of scientific error. There is a clear correlation between being overweight and having various health problems, particularly Type 2 diabetes. So nobody looked more closely at that. Everyone is advised to lose weight.
But then they did look more closely and low and behold we find: For most people, carrying extra weight is actually protective. At any given level of fitness it is better to have more weight.
So why is carrying weight associated with disease? The answer is that most people who are fit are relatively slim because it is hard to keep the weight on if you get fit. So being overweight is correlated with lack of fitness, and that is the problem. If you can be fit and keep the weight, with a high proportion of muscle, then that is ideal.
Medical science seems particularly prone to jump to conclusions based on correlation alone, but it is an easy mistake in many disciplines. Medical science is pretty good at other sorts of errors, including pure guesswork, like "eating fat makes you fat" (most people lose weight on a high fat low carb diet); or eating cholesterol will increase your cholesterol levels leading to heart disease.