When I ran a Data Science team we primarily hired Physicists and Mathematics majors and not CS graduates for this reason. It mostly worked as intended (untapped source of excellent candidates), but some of them could not for the life of them pick up software development / writing manageable code with a team. They were so used to writing unmanageable scripts that didn't have long-term time horizons (think: horrors of hundreds and thousands of lines of R-stats code in a single file, uncommented, and brutal to look at, with the expectation we'll just plug it into R-script on the command line) that occasionally this became a very tough habit to break.
Still, besides that issue - which all novice programmers have, but Data Scientists come in at a much more senior level - it was a great market advantage, one that I think is largely gone today, as companies understand the need for statisticians and economists who really and truly understand modeling and math.
Physicists and Mathematics majors can only be better than a CS grad, if they come prepped with Softwrae Development experience. A CS grad can communicate better with the code they write and most of the time assuming it's straight CS have knowledge and experience of ML that exceeds a Physics/Math major.
Anecdotally, I've worked in places where this is a major source of contention - The Data Scientists treated as talented individuals (who produce broken solutions which work for cherry picked data sets), and anyone else is just a monkey who maintains and fixes the broken code.
learn AI, start a company with a bunch of buddies with the sole intent of being acquired for your talents.
There was a company that did this a while back, I don't even think they actually had a product, they just knew that one of the big four would pay millions to acquihire them.
Still, besides that issue - which all novice programmers have, but Data Scientists come in at a much more senior level - it was a great market advantage, one that I think is largely gone today, as companies understand the need for statisticians and economists who really and truly understand modeling and math.