Those deals made Mr. Hsieh rich, but loanDepot catapulted him to a new stratosphere of wealth. Mr. Hsieh — by far its largest individual shareholder — became a billionaire on paper when the firm went public in February. LoanDepot’s shares debuted at $14; they have since dropped to about half that price, leaving the company with a valuation of around $2.2 billion.

The planned initial public offering was a motive for the company’s executives to cover up Mr. Hsieh’s increasingly reckless behavior, Ms. Richards said in her suit. In 2020, as the offering approached, loanDepot paid what it described in regulatory filings as “a special one-time discretionary bonus” to its leaders. Mr. Hsieh received $42.5 million, and other top executives took home cash bonuses ranging from $9 million to more than $12 million.

Ms. Richards, who said she was demoted in November and left out of that special bonus round, resigned in March. Her lawsuit seeks compensation for unpaid bonuses and forfeited stock that she estimates would have been worth at least $35 million.

LoanDepot is in the vanguard of a group of online upstarts that use technology to speed up and simplify mortgage loans. Last year, it originated nearly 300,000 — twice the number it did a year earlier — and was the nation’s fourth-largest mortgage provider in dollars lent, according to iEmergent, which tracks industry data.

Mr. Hsieh has long put a priority on growth and regularly adds new incentives and products to his firm’s lineup. “We will never be a company that is satisfied or one that rests on our laurels,” he told analysts on an earnings call last month. Some workers have said they appreciate the intensity and opportunities for big paychecks, but complaints about crushing workloads, high turnover and burnout are common among former employees.

Ms. Richards’s complaint describes the company, which she joined in 2018, as having a “misogynistic ‘frat house’ culture,” where harassment was commonplace and top sellers were feted at wild parties that sometimes involved drugs and prostitutes.

In 2019, a high-ranking woman at loanDepot accused a male executive of sexually assaulting her at a company party on Mr. Hsieh’s boat; Ms. Richards, who was not at the event, was asked to run the investigation because the company’s male officials, including its head of human resources, did not want to, her suit said. (She said she had learned that both employees were drunk and disagreed about whether the encounter had been consensual.)