The disappointment of last model’s release more than a year ago led to an expensive overhaul of the company’s AI operations.