Facebook is in crisis. And the firm's chief operating officer, once the golden girl, is taking the heat.

It has been a sharp turn for Sheryl Sandberg.

Just last year, the Facebook executive was touring to promote her latest bestseller, basking in the glow of being a global business celebrity, frequent presence on most powerful women lists and rumoured US political candidate.

But as Facebook has lurched from scandal to scandal over the past 18 months, investors, customers and and lawmakers alike have been looking for a scapegoat.

And with Mark Zuckerberg - who founded the social network out of his Harvard dorm room in 2004 - perceived as nearly untouchable, the pressure has mounted on his second-in-command.

Mr Zuckerberg and Facebook's board have said they stand by Ms Sandberg, resisting calls for her to step down.

But when former First Lady Michelle Obama used uncharacteristically loose language to dismiss Ms Sandberg's career advice catchphrase, "lean in", she seemed to underline just how far Ms Sandberg's star had fallen.

"It's not always enough to lean in because that [expletive] doesn't work," Mrs Obama said.

Some of the anger directed at Ms Sandberg makes sense.

Ms Sandberg, who helped develop Google's ad business before joining Facebook as chief operating officer in 2008, is a key architect of the world of online advertising.

That industry is now reeling from a series of scandals related to the collection of personal data, election interference by foreign governments and discrimination complaints.

Ms Sandberg has overseen Facebook's response to the controversies, which has seen the firm publicly pledging to do better, while privately hiring a hard-nosed opposition research firm to investigate critics and competitors.

The strategy has failed to quell the criticism.

Facebook's market value has plunged by nearly $200bn since July, US authorities have re-opened investigations and lawmakers appear increasingly inclined to pass new rules regulating the firm.

Recent reports in the New York Times that revealed some of the more unseemly details of the campaign - such as queries about whether investor George Soros stood to gain financially from his criticism - only aggravated public outrage.

"Shame on you, Sheryl. I believed in you, I leaned in. You are a fraud. You were supposed to be the adult supervision, but you are just another corrupt, corporate shill," one woman, Carol Tiernan, wrote recently on Ms Sandberg's Facebook page.

Few would argue that the fault lies with Ms Sandberg alone.

Mr Zuckerberg, who has been called to testify before lawmakers in numerous countries, has stumbled repeatedly on questions of privacy, with flare-ups on the question that date to the earliest days of the site.

But Mr Zuckerberg's status as founder and controlling shareholder has offered him a measure of protection.

And the public long ago wrote him off as a robot, characterised by an uncomfortable amalgam of confidence and awkwardness.

Ms Sandberg meanwhile has cultivated a celebrity profile with a 2013 bestseller, Lean In, which counselled women to embrace their career ambitions; as well as a 2017 follow-up, Option B, which grappled with the sudden death of her husband.

The books offered up Ms Sandberg as a role model, which may be why her part at the firm feels to some like such an unsettling betrayal.

"I had so much respect for you, not any more," Daniel Marein-Efron, wrote recently on Ms Sandberg's Facebook page.

In some ways, the anger directed at Ms Sandberg represents a familiar story.

Repeated academic studies have shown that firms are more likely to install female leaders at times of crisis - a phenomenon known in academic world as the "glass cliff".

And ultimately, many of those women end up taking the fall for problems - even when they bear less responsibility for them than Ms Sandberg does.

Female leaders are also subjected to personal attacks of a sort that men like Mr Zuckerberg tend to escape.

In this case, media accounts, quoting anonymous employees, have provided detailed studies of Ms Sandberg's leadership flaws, faulting her for things like creating a clique-y environment hostile to negative feedback.

"That is very much consistent with the kind of blame and scrutiny that women corporate leaders receive when they are managing their companies through crisis," says Christy Glass, a professor of sociology at Utah State University, who studies women in business.

But Ms Glass said that while the some of the vitriol directed against Ms Sandberg is clearly "gendered" - she also presents a special case.

"She is exceptional in the extent to which she has cultivated a very public corporate personality and by doing so, she's a household name in the way that [chief operating officers] of other companies are not," Ms Glass says.

Brenda Darden Wilkerson, president and chief executive of AnitaB, a charity that works to increase diversity in the technology industry, says she worries the heat attracted by Ms Sandberg will discourage other companies from appointing women to positions of power.

"When people like Sheryl come under undue scrutiny, it creates a culture that impacts our ability to move forward with an inclusive and diverse workforce," she says.

"It's not to say that these criticisms that are being [lobbed] against the company aren't valid. It's just that they need to be [lobbed] in a way that are not personal to the female leader and more objectively to the male leader."

No board wants to be the one that fires one of the few female technology leaders - especially while letting her boss escape without consequence, says Scott Galloway, professor of marketing at New York University's Stern School of Business.

But he says the way to resolve what has become a tortured public debate over whether Ms Sandberg should stay or go is simple: Fire Mark Zuckerberg as well.

"It is unfair that now everyone is calling for her head," he says. "The appropriate response is to call for the head of the CEO and the COO."

"That's ok," he adds. "CEOs and executives are fired all the time."

Mr Galloway says he expects Ms Sandberg to leave the company within the next 12 months.

But he cautions: "To a certain extent, all of this naval gazing and existential crisis around Ms Sandberg is a side show."

"This problem will not go away unless there is a dramatic change in the approach and culture of the firm and the only way you do that is by removing the CEO."