These companies are so rich and already have existing revenue in billions, so even if the Ai bet doesn't work out, they can simply pay off their debt using their ordinary revenue.
It would disappoint the stock market, sure, but I doubt that it would create anything more problematic than maybe a 20% drop in the stock, temporarily. And that would be because investors would know that the future will not contain the promised profits. But the companies would still be fine, still be able to pay their debts, and still be able to run their business as usual.
Its not like in dot com where companies without revenue got to borrow tons of money they could never pay back.