Great points. Besides if one look around even today beyond people who somehow still succeeding at software hustle, there are already tons of people fallen off IT gravy train. A lot of manual testers who would make decent living are now eliminated by automation. Software document writers jobs are kind of gone. Developers are supposed to create document themselves on Confluent wiki etc. A lot of prized SAP consultants and such from past are now downgraded to generic mid level project managers / IT managers if they were hold onto IT jobs at all.
I can list lot more jobs e.g exchange admins, app server admins, DBAs, they are either gone or far fewer available. And lot of people were not able to up-skill and fell out of race in just a matter of 15-20 years.
There are two ways to think about your work in IT, one is as a person who really understands how to use a particular technology, and the other is as someone who can figure out how to use technology in general to achieve some particular end. Anybody who picks the first path might have a very well paid career for the few years that that technology is relevant, but will eventually crash out. You need to always be looking at the next thing and keeping your skills and knowledge up to date. Nobody ever guaranteed that Microsoft Outlook admins would have a career for life.
I feel like this begs for a careful analysis, we could probably drop a dozen more reasons as to why demand in devs and perhaps even in # of lines of code might plateau or decline in the near future, without even mentioning AI at any point.