As an old boss of mine said when hiring, "Does this person have ten years' experience? Or one year's experience, ten times?".
What he meant (i think!) was that someone who's been doing something for ten years might not know any more than someone who's been doing it for a year - they've just been doing the same thing over and over again.
I think your old boss's meaning was pretty much the opposite -- 10 years of deep experience in a field can be much better than 10 years spent hopping around from job to job across fields. Applied to programming, this would be something like "I want someone who has been doing ML for 10 years, not someone who has been hopping from hot trend to hot trend every year and just now happens to be doing ML".
Specialization and diversification can both be good. I think it's spending 10 years making the same mistakes, not learning, that's being criticized here.
What he meant (i think!) was that someone who's been doing something for ten years might not know any more than someone who's been doing it for a year - they've just been doing the same thing over and over again.