External factors certainly come into play like environment. You're not a completely closed system as you point out based solely on food. You may sit in a cold office shivering throughout the day or in a hot room sweating, these factors will effect your energy expenditure (and even intake) differently just to maintain your existence.
Something similar will happen with excess ethanol consumption. Your body will preferentially use ethanol for immediate energy needs, but there is no pathway to store it as fat. However any fat or carbohydrates in the diet will immediately undergo lipogenesis while the ethanol is metabolized.
The end result is that it’s physiologically impossible to gain body fat on a diet of lean protein and wine or spirits. However that’s a rather unhealthy diet otherwise so I wouldn’t recommend going all in on the piss out the protein plan.
It’s good to know though that if you’re taking an alcohol cheat day then stay away from beer and mixed drinks as well as fat and carbs all day and until the next morning. Instead eat something like lean chicken or fish with near zero calorie vegetables like lettuce or cucumbers or what have you.
I think the understanding about dietary calories comes from the agricultural world where calories are much more involved in the economics of animal growth and weight gain. So we might not even be that sure that what we consider dietary calories are accurate for humans.
Assuming they are accurate, each individual digests a different % of all calories they ingest and it depends on many factors. It's a very imprecise science.
If you want, you can eat a given number of calories each day of just one meal (like Huel or Soylent) for a month. Then, for the last week of the month, you can see how much weight you gained or lost over 7 days. You will also need a medic to estimate your basal metabolic rate and you would need to stick to your daily physical activity habits consistently. And then you can arrive at some number of what % of dietary calories you absorbed for that particular food with those particular eating times, exercise habits, and so on.
I think it's a very impractical test. Maybe it might be easier to do in a very controlled environment in terms of energy expenditure, like in weightlessness. But then the weightlessness is a factor in digestion, too.
If someone found a way to accurately determine what % of dietary or fuel calories humans really absorb, the data would probably be as impactful in our understanding of diets as the Minnesota starvation experiment.
Then your actual rate, whatever it is or how much it varies, hardly matters long term. Sure there would be variance, but on the whole, long term, you are only caring about the weight on the scale. So you measure calories in and your weight, and given you are consistent about burning calories exercising and the food choices in your diet, dialing back calories in will make a change on the scale, maybe a bigger or smaller one for different people, but a change no less. No one runs on air.