I'm mostly agreeing with you, but I think you may be going slightly too far.
If you absorb more calories than your metabolism burns, then you gain weight. Variables are:
- Calorie content of food.
- Ability of your body to absorb those calories. This includes what form the calories are in (petrol, obviously, doesn't work), but also may include your gut biome, and perhaps other person-specific issues.
- Your activity level (not just exercise, but non-exercise physical movement as well).
- What your food does to your metabolism.
Sure, if you eat too much of the wrong things, it hurts. If you exercise, it helps. But it's much more complicated than that.