I'm astonished how many commenters are desperately trying to find loopholes in simple laws of physics.
I (and most of the other commenters here it seems) keep trying to communicate that it is possible to be both technically correct and simultaneously not useful as a weight loss strategy.
It wont work for everyone though, since many people can't make themselves eat less without following some rituals, the problem there isn't CICO but that those people can't implement a CICO diet properly. But that doesn't mean that CICO is a useless concept for losing weight, it just means that those people needs more help to keep their psychology in check.
Saying that CICO isn't useful when CICO is the basis for every single weightless diet in existence is just ignorance or a lie. All weightless diets either makes you absorb less calories by some method, or make you burn more calories, so the first thing when looking at a diet is asking how it relates to CICO. Trying to sweep that under the rug as some old school nonsense principle that has proven to not work just proves how much nonsense there is in nutritional "science".
Knowing what mechanisms and processees go into losing weight can make the journey much more intellectually stimulating, satsifying for the participant and smooth out incredibly rough bumps in the road to losing weight. CICO can't fill this need for tailoring weight loss to smooth out the efficiency losses you get with brutal cuts into one's life and psyche.
Pumping out a single metric and hammering flat all the differences in personal process with psychology and ritual screams of unnecessary suffering. It's probably wrong to use oneself like that.
Very few people live according to the physics based description of what their life should be... However one would derive that idea without hiding or ignoring personal presuppositions?
If you're simply referring to the physics of CICO that underpin most diets then I have already acknowledged it is correct.
But being correct does not make it necessary knowledge for people looking to lose weight any more than Hamiltonian mechanics is necessary knowledge to play tennis.
If I still haven't managed to convey the distinction between technical correctness and practical utility yet then I have to conclude this is a gap I cannot bridge and I wish you luck.
First, note that the calorie estimates on food packaging can be off, sometimes by as much as 25%.[1] Restaurant foods have an even wider discrepancy. [2] And as you point out, different people will digest them and absorb different nutrients from the same food making comparisons difficult. For example, I absorb a small fraction of the calories from dairy products because they unfortunately pass through my digestive system quickly and remain largely undigested.
And as others have noted, accurately estimating calorie expenditure can also be difficult without professional equipment, so in practice measurements of calories expenditure can be off by a significant margin as well.
Combining all of these sources of error can result in excessively wide error bars. Someone who relies on calorie in/out estimates to dictate their consumption may end up eating significantly more or less than is optimal.
Of course, even if counting calories in/out is wildly inaccurate it might still have a positive effect if it causes people to be more aware of the food they eat. Unfortunately I'm not aware of research that teaching people to count calories results in better health outcomes than other diet strategies. (Though it does seem to increase people's odds of developing eating disorders. [3])
It's one of those cases where the theory may be correct in theory but that doesn't make it particularly useful in practice.
[1] https://pubmed.ncbi.nlm.nih.gov/8371446/ [2] https://pubmed.ncbi.nlm.nih.gov/21771989/ [3] https://pubmed.ncbi.nlm.nih.gov/30155857/