A little over two years ago, William A. Ackman, one of Wall Street’s brashest and most self-assured hedge fund managers, was on top of the world. A billionaire before he hit 50, he was generating double-digit gains for his investors and raking in hundreds of millions in fees for his firm and himself.

Hailed as a master investor, he clinched his highflier status in the fall of 2014 by paying $90 million with some friends to buy the penthouse at One57, a 13,500-square-foot aerie in Midtown Manhattan overlooking Central Park. He didn’t plan to live there — it was an investment property — but until he sold it, the apartment would make a good party space, he told The New York Times.

If Mr. Ackman were a stock, that might have been his peak.

Today, things are very different for him. His company’s performance is way down, he is in the midst of an expensive divorce, and on March 13, he and investors in funds run by Pershing Square Capital Management swallowed a $4 billion loss on Valeant Pharmaceuticals International, a beleaguered drug company.

As bad bets go, it was one for the record books. Valeant was a big Pershing Square holding. In May 2015, Mr. Ackman said Valeant’s acquisition strategy made it “a very early-stage Berkshire,” referring to Berkshire Hathaway, Warren E. Buffett’s investment vehicle. But only a few months later, Mr. Ackman and his investors began riding Valeant’s shares all the way from $262 to $11, driven both by rival investors who had bet against Valeant’s shares and former fans who dumped the stock as bad news emerged.