I think the issue is that calories in calories out is very hard to measure outside of clinical settings.

1. Bulk food manufacturers can have a decent variance in the actual calories compared to the anticipated calories. Nutrition labels can be inaccurate by up to 20% when it comes to listing calories, according to the FDA, so that 400 calorie meal could be 320 or 480. If you're eating for 1600 calories a day and relying on pre-made foods, then you could be eating 1920 calories a day unintentionally.

2. Not every body processes every calorie consumed. A simple example of this is the weight loss medicine Alli, which can prevent your body from absorbing fats. So even if you ate a 400 calorie cup of olive oil you may only absorb 360 calories of it.

3. Metabolism itself isn't a set standard. Unless you have had your metabolism tested to ensure that it is operating at the standard level, you may be naturally burning fewer calories than your height, weight, body fat, muscular density, and age would otherwise indicate.

A simple test for the last one is to take your temperature in the morning, afternoon, and evening. Standard is 98.6, but in metabolically impaired people, it can decrease by a few degrees. Colder body means fewer calories being burned. This happened to me, where at ready my body was burning 300 calories a day under my expected TDEE and to reverse it I had to eat more, put on weight, and exercise heavily with weight lifting heavy weights to build muscle to reverse it. My standard body temperature had dropped to 97.3 or less, and it's been months of undoing the weight loss that I had achieved to get it back to normal.

4. We are still learning about the various effects of microplastics and other man-made forever chemicals on the human body, but many of them are known endocrine and hormone disruptors so it is likely that future science will discover that these unavoidable chemicals may increase the likelihood of obesity by either interrupting the satiation mechanism or decreasing the body's ability to respond to insulin.

5. Once you become obese in the modern sense, you are now the proud owner of an oversized organ of fat cells that do not simply die when you lose weight. They will release their lipid stores, but the cells themselves remain, sometimes for life. When your normal organs are not signalling that they need nutrition immediately, these fat cells will preemptively consume any excess sugars and fats in your body to refill themselves. Being previously overweight dramatically increases the likelihood that you will become overweight again because of this, and the only potential solution is either having liposuction or using some other non-invasive technology that can literally directly destroy the fat cells, and either option is going to be expensive, time-consuming, and risky to some degree.

If environmental factors cause you to overeat, due to stress, maladaption, or due to exogenous chemical exposure and you become overweight because of it, there can be many, many reasons why you would then become more and more overweight afterwards.

Yes, at its basic level, it is calories in > calories out, but that overlooks external factors that can make consistently eating fewer calories than you burn a herculean effort that can very well never ever end.