A calorie deficit implies knowledge of metabolic rate which can be highly variable. While calories in can be trivially counted, calories out needs to be calculated and cannot assume a significant level of accuracy.
Regardless, the problem with solving the obesity epidemic isn’t that people can’t lose weight, but is keeping weight off after reaching a goal weight.
Say that a body is in a caloric balance, and at the same time in a strange state in which it is storing N calories as fat, while releasing N calories from breakdown of lean tissue: a lean-to-fat conversion is going on, so to speak. That body will be losing mass, because a calorie of lean tissue represents much more mass than a calorie of fat storage.
If that same body then starts to release N + M calories from lean tissue, it will still be losing mass, while gaining fat.
The only question of how physiologically likely are these thermodynamically valid situations. We do know that people who experiment with "yo-yo dieting" can end up with worsened body compositions, but probably not due to gaining fat while dieting but rather (1) losing lean tissue while dieting, while losing some fat and (2) rebound weight gain while not dieting possibly exacerbated by a lowered metabolism due to less lean tissue.
Still, consider this thought experiment. A dieting person wears a backpack which is considered part of their body. Every day, a hundred grams of lard is added to the backpack, and this lard is counted as part of their caloric intake. The person diets and exercises in such a way that there is a caloric deficit. That person will be undeniably gaining fat in that backpack. It's thermodynamically possible for the body to be promoting fat storage in some area, regardless of what else is happening.
But if you have metabolic damage, you may have a lower metabolic rate than expected, meaning that the same 1200 calories a day that should cause you to lose a lb a week is actually just under maintenance calories.
Anecdotal, but this happened to me. I lost 100 lbs through diet and just got stuck. Couldn't lose any more to save my life. I ate 300-500 calories under my expected calorie expenditure every day.
Then, I got my metabolism tested and found that my BMR was at 300 calories a day under what it should have been, which meant that I was eating maintenance or overeating by 200 calories a day (and I was already feeling starving at that point!)
To cut another 300-500 calories out of my diet would have been untenable. I'm still trying to figure out what I can do.
Exercise more? Check. Do blood work and make sure everything is in order? Check. Vary my diet or try different diets? Check.
I think the only thing left is to try chemicals. Nothing else seems to either raise by base metabolism or decrease my intake needs.
The nice thing about increasing strength and muscle mass is that it’s going to burn calories for you 24/7, not just while you’re doing the activity.
I've been hitting the gym, doing mostly heavy lifting 2-3x a week and easing off on my calorie restriction. The weight is going back on fairly quickly but I'm also seeing good gains and progression in my strength & lifts.
For instance, when I started, one arm curl was at about 35 lbs, now 3 months later I'm curling 55, bench was 120, now it's 160 (but I'm not pushing hard on gaining bench) and squat machine has gone from 175 to 280.
No, that would defy the laws of thermodynamics. However, it is possible to consume more calories than you burn and lose weight, because there are complexities around how your body decides to store fat, signals to burn fat, etc.
Even if it was simply a thermodynamics problem (which I don't think it is), there are also issues with appetite. Sure, you can count calories for the rest of your life, but doing that is not only difficult to measure correctly, but very difficult to maintain if you still feel hungry all the time.
I think one of the reasons a ketogenic diet works for a lot of people is that after a period of adaptation, you stop getting hungry every 4 hours.
All these "we found the cause of obesity" dance around the problem.