A big part of the failure is that the system is not entirely digital, and not entirely automated.
People can still submit paper returns (and this is common for any businesses beyond a certain size- I've seen 200+ pages for a small-ish company's return). Supporting documentation and schedules can be non-standard (like receipts, letters, exhibits, spreadsheets, contracts, etc.), and the forms themselves can be hand-written and the other docs can be on inconsistent paper sizes so bulk ocr of any kind is rough.
Really, you have several challenging problems- maybe 200M individual returns filed every year, who knows how many corporate returns, all of the daily/monthly/quarterly filings for payroll, then for tax season you have an army of temp workers who are responsible for doing manual data entry which is cumbersome.
Then you have the financial management/reporting/reconciliation side of it. The volume is staggering. Electronic transfers in both directions, handling paper checks both to and from taxpayers. More manual data entry for manual payments.
And the kicker of all this is that it actually works for some pretty reasonable value of that term. And everyone here knows what the code probably looks like and we definitely know what the code's documentation looks like.
How would you like to sit down with the nearly 7,000 pages of the US Tax Code and start taking a bite of that monster? It's not a reference manual- the amount of cross referencing with other laws and regulations required would be monumental.
So, you are correct, AI is definitely not the answer; But I suspect the AI is for rooting out tax cheats (or maybe certain tax cheats), not running the system itself.