If investment in AI don't pan out (i do think that it will pan out, and those trillions will come) then those companies would just pour even more billions into whatever big thing/promise would come next. Rinse and repeat. Because some of those things do generate tremendous returns, and thus not playing that game is what really constitute true loss of money.