Why would you need to consult a doctor about not giving your kid dairy?
And since GP said infants, if we're including (human) breast milk as 'dairy' then it probably is reasonable to ask doctor about it - IANA parent either but I think the standard powder or whatever substitutes are still (non-human) dairy products?
Just because in your socio-economic circles, no one is a militant enough vegan to feed a nursing baby Oatly or whatever, doesn't mean people out there don't need some guidance.
I mean there's vegans out there putting their carnivore pets like cats on vegan diets, so you can see someone thinking "hey it's just another milk replacement.. it's healthy!" feeding it to an infant is certainly not a 0.001% edge case.