If this is true, it makes counting calories incredibly hard for anyone who has a varied diet.
If each ingredient in the food you eat is digested at a different efficiency depending on the bacteria in your gut and other specifics of your digestive system and the food itself varies by upwards of 20% because of natural variation and how much you cook it, then it seems it would be downright impossible.
I've tried in the past and given up (I would gain weight on a 1200 calorie diet of processed diet food). I finally just went to an extreme nearly vegan diet where I get over 90% of my calories from plants and exclude grains, oil, sugar and salt. It makes it virtually impossible to overeat even if I have to eat 4x the mass of food other people.