In its heyday a few years ago, WeWork said it would reinvent offices. But the company never created a sustainable business or changed how most people worked.

The business of offering flexible office space on short leases to individuals and businesses, a model that WeWork hoped to make mainstream, remains a niche in commercial real estate despite the billions of dollars the company and others invested in the approach. Flexible office space accounts for less than 2 percent of all office space in the 20 largest U.S. markets, according to Cushman & Wakefield, close to its share before the pandemic.

WeWork filed for bankruptcy protection this week in an effort to quickly slim down its portfolio of office spaces. The company wants to give up over 70 leases right away, with possibly more to follow. Other co-working companies may take over some of those locations, but some owners of office buildings said they were not expecting this approach to ever amount to more than a small part of their business.

Many employers are paring back their office space because workers aren’t going in five days a week after growing accustomed to working remotely or on a hybrid schedule. Office vacancies are at their highest level in decades, with lots of space available for sublet often at a deep discount from the rents that prevailed before the pandemic. WeWork’s bankruptcy will only make the situation worse by leaving landlords with more space to fill.

Michael Emory, the founder of Allied, a real estate investment trust that owns office buildings in Canada’s largest cities, said flexible office providers would always exist, providing space for smaller companies to operate without signing long leases. But he said it would never make up a third of all office space, as JLL, a real estate services firm, predicted before the pandemic would be the case in 2030.

“There wasn’t a snowball’s chance in hell of that happening,” Mr. Emory said.

He said office landlords would keep offering space to co-working firms in some buildings because they attracted tenants that might grow and want to lease their own space in the future.

David O’Reilly, the chief executive of Howard Hughes Corporation, a developer focused on large developments that often include homes and offices, said co-working was a nice amenity for some tenants but wouldn’t take over the commercial real estate business by a long shot.

“When co-working becomes a disproportionate amount of the building, they become directly competitive with the landlord,” he said. Howard Hughes has two leases with WeWork, and Mr. O’Reilly said he was talking to other co-working providers about taking over the space.

Still, some co-working executives said they expected to do much better than WeWork because they were pursuing a different business model. WeWork leased millions of square feet from landlords, hoping to take in enough revenue from its customers to cover its costs. But that never happened, leading to multibillion-dollar losses.

Other co-working firms say they don’t lease their space, instead operating offices for a set fee or a cut of the profits. Co-working companies using this model are less likely to collapse, but it can also mean they earn less when times are good.

“By sharing the profits with the landlords, it allows us to do a lot more,” said Mark Dixon, the chief executive of IWG, which was one of the first companies to offer flexible office space in many locations and which operates several brands, including Regus.

IWG might get a third of the profit on a co-working space that it doesn’t lease, while the landlord gets the other two-thirds. While IWG might make less money, the company does not have to borrow to finance big lease commitments, something that has become harder because banks have pulled back from the commercial real estate business.

Mr. Dixon added that co-working should do well in the age of hybrid work, when employers are looking for flexible and shorter leases that give them enough space for some employees to be in the office every day. They can also convene larger groups of workers for meetings and have smaller offices in places they didn’t before.

“They realize that they don’t have to have everyone working from singular buildings in order to get work done,” he said. “You do need to bring them together regularly, but just not every day.”

IWG signed deals to open over 600 new locations around the world in the first nine months of the year, many of them in smaller U.S. cities and towns. At the end of September it had 3,455 locations, up from 3,323 a year earlier.

Jamie Hodari, the chief executive and co-founder of Industrious, a New York co-working firm that works closely with landlords, is similarly bullish. His company’s revenue has been growing almost 40 percent this year, he said, roughly double what he expected. And he said Industrious, which has 187 locations, up from 85 at the end of 2019, had nearly tripled its revenue since before the pandemic.

“It’s a time of enormous demand,” Mr. Hodari said.

And John Arenas, the chief executive of Serendipity Labs, a flexible-office-space company that focuses on suburban markets, said demand had grown in recent months as many companies began to firm up their return-to-office plans.

Some of his customers tell him, he said, “I just need to have a place where people can touch down, collaborate, meet up, drop in and feel like there’s a hospitality element.” Serendipity Labs has 34 locations, and Mr. Arenas predicts it will have roughly 50 in the first quarter of next year. This year, it took over a former WeWork location near Grand Central Terminal.

Stijn Van Nieuwerburgh, a real estate professor at Columbia Business School, agreed that sharing office space had a strong appeal for employers. He said he was “a big believer in co-working.”

But he added that many office building owners would most likely offer their own co-working spaces to tenants, reducing or eliminating the need for companies like WeWork. He said some building owners would start to run office buildings more like hotels, with individuals and companies signing short-term leases directly with the landlords.

“There’s nothing special about WeWork that Related or Vornado couldn’t replicate,” he said, referring to two large commercial real estate companies. “I don’t think co-working is dead at all,” Mr. Van Nieuwerburgh added. “In fact, the disappearance of WeWork opens up a window of opportunity for landlords to take that space over.”

Julie Creswell, Matthew Haag and Gregory Schmidt contributed reporting.