I am bad at coding and it is a skill that I do not think everyone can achieve to a professional level, thus telling people to "learn to code" is similar to telling them to "just hustle", "hit the bricks and hand out resumes", and other flippant stories that mean you stop having to think about poverty.
That said, I do believe the narrative actually was true for some people at some time. Maybe in the 90s and early 2000s if you were able to cobble together a computer from bits your university was throwing out and you had internet access, you could punch well above your weight. But that certainly was never true for everyone.
(I like to be optimistic about people's ability to learn things, mostly hampered by access, time, and lack of interest, but I went to a boilermaker's course recently to learn how to weld and none of those kids were going to learn how to code even if they were interested, whatever their other skills were.)
I sometimes feel like the last person that managed to land a decent tech job without an undergraduate degree, but a good part of that was being able to play a normal, likeable person in the interview.
I think what you say might be true for any field that's new enough. There's high demand for labourers, very little skill around, and a low barrier for an autodidact to pick up the basics and outshine the competition.