Here's the thing: It may be that 2400 calories would take the average 40 year old male and only have him continue the socially acceptable weight gain of a few lbs a year. Or maybe the average (already overweight) male would maintain his weight at 2400 calories.
But in any sane world, that's like the 90th percentile of calories required when consumed with a carb-heavy american diet and I'd argue almost no sedentary person requires that much. Just plugging in the basal metabolic rate numbers gets something well below that.
Norwegian Institute of Health has a calorie calculator[1] based on scientific studies.
For a 40 yo male, 180 cm (5' 10") high and weighing 80 kg (176 punds), it spits out 1800 kcal at complete rest.
That then gets multiplied by a factor of 1.4-1.5 if you're a sedatary office worker, resulting in around 2400-2500 kcal.
This number is for maintaing weight. I used the calculator to find my 500 kcal deficit to lose weight, and based on my actual losses it seems quite accurate.
[1]: https://nhi.no/skjema-og-kalkulatorer/kalkulatorer/diverse/b...