For two years, markets’ belief that the rise of artificial intelligence would usher in a new era of productivity growth has fueled trillions of dollars in stock-market gains.