Software is a complicated problem breh. Some of the smartest minds of recent times have a hard time writing software. It definitely isn't an easy problem to solve. Imagine writing software to solve a problem as a bad game of whack a mole. Solving whatever you're trying to do is tough enough. If you have something working, great, now the hard work begins though.
One such problem is you'll have people who are actively trying to break and exploit your software systems. Legit think of what software can already do on screen and in the real world. If you can code up some crazy app from scratch doing some next-level stuff, people can code up apps to attack and exploit as well. For each of those features you additionally end up with more potential attack area. The amount of real-world impact software has is really quite remarkable, as are the clever solutions (and attacks) that have been done already.
For example this cyberweapon/software bug/virus impeded Iran's nuclear program:
en.wikipedia.org
Your company's app/system may be working straight up fine until someone finds a vulnerability with it. In order to fix that vulnerability System X must be rewritten which means System Y must be re-written. Everything may be working fine until someone exposes a new vulnerability in System Y which means System W must be fixed and now System X needs to be changed again because it depended on System W, however that changes how System A works.
It's difficult to keep things in a vacuum, because the world doesn't work in a vacuum. Think of how different each of our computers are for example: code must be written to work on as many machines and environments as possible. Then there's all the hardware and gadgets that we used to carry around now replaced by a phone. Only more will happen as well until we stop using software altogether as it's basically a sandbox.
People fishing for vulnerabilities and attackers breaking your app in ways you don't see coming/accounting for will always make this shyt more complicated. Someone finds the right bug to exploit and you're looking at a massive rewrite while keeping everything else that was working the way it was intended. Paying customers are at stake. If fixing that breaks something for them, they may cancel their service. It doesn't even have to be malicious, but some end user accidentally finding just the right amount of crazy parameters, combinations and configurations to blow things up and cause a headache to engineering teams for a problem they thought they solved (where the fix can actually open up an exploit somewhere else).
It's two sides to the same coin really: software complexity.
That's why when people say A.I will take care of all this, my answer is NOPE. Human ingenuity is too ridiculous