The selloff underscores how stretched the AI-fuelled rally has become with key indexes trading near record highs