As a counter-point, I would like to point out India's IT industry.
When the IT outsourcing industry was booming and there was a serious programmer shortage, outsourcing firms such as Infosys, Cognizant, Tata would hire college graduates en-masse regardless of major (like, entire batch of 20XX would get a job offer). They would then spend 6 months actually training them and weeding out poor performers. The ones who get through would be placed on actual projects for their clients. I do not know if this still happens today due to the sheer number IT majors on offer in India.
Now you can rightly argue with regards to the overall quality of products they created and the culture they proliferated but for their clients it appeared to suffice to achieve their business objectives. Sure most of them won't be FAANG grade but might be totally adequate for making some CRUD app or maintaining some system.
IMO, I don't think one needs a four year degree to code, two years at the max would suffice (obviously not for cutting edge work) . In fact, I would go as far to say beginners can be trained on a good declarative low-code (not low code) guardrails-type DSL incorporating best practices to create simple CRUD or reporting web apps. There have been many attempts but I don't know if this is solved yet.