SaaS partially took the place of bespoke projects that people were doing before. They never stopped doing those of course and there were also off the shelf packages that people bought before SaaS.
AI lowers the cost of creating bespoke software that competes with both. Instead of buying a one size fits all thing that half does what you need, you can now have a thing that is a bit better suited to your needs. There will be a lot more demand for those things. A lot of these things are going to require deep domain knowledge and some system thinking skills.
This is still hard enough to do well that a lot of the creation work will be outsourced to professionals. Even if that involves the use of AI prompting. Maybe after naive attempts to do it in house fail. My hunch is that there will be a lot of growth for those that can do these types of projects efficiently and that it might more than offset the job losses in the SaaS sector.
There are a lot of of companies that are still under using software. There never was any good SaaS that fit their needs and they lacked the skills to do it themselves. When you lower the cost of something (creating software) the market usually grows. A lot of things that were previously not feasible are now doable.