I think this is like the "does a tree falling in the woods with no one to hear it make a sound" argument. It is all in how you define the words and in this case who you are giving the advice to.
I have some spare fat due to some medical issues that caused me to gain a bunch of weight. I fast regularly so my body is perfectly capable of burning fat for fuel (despite claims in here that anyone who can do that is already skinny) that means I'm always in a calorie surplus no matter what I do or don't eat.
There are macro and micro nutrient needs that have to be met, protein and specifically leucine for example. Beyond that, I don't need to eat more than maintenance calories to gain muscle.
Maybe someone well under 15% body fat will have an issue gaining muscle without gaining weight but I don't. I may be fat by gym bro standards but I'm pretty fit by national average standards.
Is a competition body builder sub 10% fat going to need to gain some fat to gain more muscle for next season? Yes. Does a 20% fat guy who is trying to get in better shape have the same issue? No.
Sub 10% fat is harmful metabolically just as true as being 40% fat is bad for you. Both those metabolic harms will slow muscle gain. For an average dude depending on genetics you probably want to walk around in the 15% ish range for optimal health.
The right answer to all of this depends on the person. If you are a dude >20%bf taking a mass gainer you are hurting yourself. If you're a dude <10%bf trying to lose fat and gain muscle at the same time you are hurting yourself.
Women naturally have higher bf% but the same concepts apply with different numbers.