AI-generated code still requires software engineers to build, test, debug, deploy, secure, monitor, be on-call, support, handle incidents, and so on. That's very expensive. It is much cheaper to pay a small monthly fee to a SaaS company.
It's not that cut and dried - it all depends on what your company needs from SaaS and how big it is. SaaS companies like Salesforce don't charge a "small monthly fee" - they charge 10s of millions of dollars per month for large corporations. It's not hard at all to push that money towards AI development and have a better solution built in-house now. Yes, it still takes serious project management skills, but so does integrating Salesforce or other large SaaS software.