The rally driven by the global artificial-intelligence boom has exposed structural vulnerabilities in a stock market unaccustomed to wild swings.