He pulled out after a social media storm that condemned the producers’ decision to replace black actor Okieriete “Oak” Onaodowan with the white Broadway legend in an effort to sell tickets, which had fallen off with the departure of Josh Groban. His final performance was July 2.

Okieriete Onaodowan as Pierre, the leading male character, in Natasha, Pierre & the Great Comet of 1812.”

Okieriete Onaodowan, from the original cast of “Hamilton,” replaced Groban on July 11. ( Previous Broadway credits include “Rocky” in 2014 and “Cyrano de Bergerac” in 2012.) Producers were quoted at the time saying they had confidence in him.

The week ending July 16 the box office gross climbed back up to $939,748 and the week ending July 23 it was down slightly to $923,571. Certainly, though, the gauge is moving in the wrong direction.

Patinkin was scheduled to appear in the role for three weeks, from Aug. 15 through Sept. 3.

Producers were surprised by the social media takedown, something they had not expected. The role of Pierre was originally played by the show’s creator, Dave Malloy, who is white, when the musical premiered Oct. 16, 2012, at Ars Nova. He continued in the role when the show transferred off-Broadway to Kazino (first in the Meatpacking District, then in Times Square) in 2013.

Scott Stangland in the American Repertory Theater production of “Natasha, Pierre & the Great Comet of 1812.

The Broadway production at the Imperial Theatre began previews on Oct. 18, 2016 and opened on Nov. 14, 2016. Groban as Pierre and Denée Benton as Natasha, were both making their Broadway debuts.

Patinkin sent the following statement yesterday to the New York Times.

“My understanding of the show’s request that I step into the show is not as it has been portrayed and I would never accept a role knowing it would harm another actor,” Patinkin wrote. “I hear what members of the community have said and I agree with them. I am a huge fan of Oak and I will, therefore, not be appearing in the show.”

Producers said they were to just trying to keep the doors open and the show running following Groban’s departure and cast changes were a financial necessity.

The Times also reported producers and creative team previously had asked another “Comet” actor, “Brittain Ashford, to take a leave during the summer so she could be replaced by a well-known singer-songwriter, Ingrid Michaelson, and did not anticipate that replacing Mr. Onaodowan with Mr. Patinkin would be seen differently.”

“The show was in desperate shape; sales after Ingrid leaving Aug. 13 were catastrophically low,” Malloy wrote on Twitter. “Show would have closed.”

Dave Malloy, the creator of “Natasha, Pierre & the Great Comet of 1812,” also was the musical’s first Pierre.

“So sorry to have missed the racial optics of it,” Malloy said on Twitter Friday. “We had to do same thing with dear beloved Brittain so in my head it was no different.”

The immersive production, with action happening around and among the audience, is the first production of Ars Nova to transfer to Broadway.

At this time, it is unclear what will happen. Onaodowan has been quote saying he doesn’t intend to stay with the show after his final scheduled performance on Aug. 13.