And many hedge fund managers found themselves crowded in the same stock. That meant big returns as everyone piled in but even bigger declines when everyone sold out.

Valeant Pharmaceuticals International, for example, was one of the most popular stocks held by hedge funds in 2015, and its stock price soared to more than $260 a share at one point. But when news of a government investigation came to light and issues with the company’s pricing strategy became apparent, the stock came crashing down. On Friday, Valeant’s share closed at a low of $24.

Mr. Ackman, who has been Valeant’s biggest cheerleader, has lost billions of dollars so far on his bet on the company. His Pershing Square Holdings is down 17.5 percent so far this year through June 7, in large part because of the Valeant position.

Other hedge fund titans including Paulson & Company and Viking Global Investors have collectively lost billions of dollars on the Valeant trade.

“I see the herd mentality among hedge funds every day,” Roslyn Zhang, a managing director at China Investment Corporation, China’s sovereign wealth fund, said at the SkyBridge Alternatives, or SALT, hedge fund conference in Las Vegas last month. Describing how some funds spend “two seconds” on one theme before deciding to put investor money behind the idea, she added: “We pay 2 and 20 for treatment like this. I am reflecting that maybe we are not making the right decision.”

All of this has prompted some self-reflection within the industry.

“We are in the first innings of a washout in hedge funds,” Daniel S. Loeb, the founder of the hedge fund Third Point, wrote to investors in a recent letter, describing a “catastrophic period” for the industry.

But for some investors, acknowledgment of poor performance is not enough. In September 2014, the nation’s biggest pension fund, the California Public Employees’ Retirement System, or Calpers, announced plans to liquidate its $4 billion hedge fund holdings on concerns that the investments were too expensive and too complicated. In April this year, the pension fund for New York City civil employees voted to exit its portfolio of $1.5 billion in hedge fund investments.