The first people to lose their jobs worked at restaurants, malls, hotels and other places that closed to contain the coronavirus pandemic. Higher skilled work, which often didn’t require personal contact, seemed more secure.

That’s not how it’s turning out.

A second wave of job loss is hitting those who thought they were safe. Businesses that set up employees to work from home are laying them off as sales plummet. Corporate lawyers are seeing jobs dry up. Government workers are being furloughed as state and city budgets are squeezed. And health-care workers not involved in fighting the pandemic are suffering.

The longer shutdowns continue, the bigger this second wave could become, risking a repeat of the deep and prolonged labor downturn that accompanied the 2007-09 recession.

Get news and analysis on politics, policy, national security and more, delivered right to your inbox

The consensus of 57 economists surveyed this month by The Wall Street Journal is that 14.4 million jobs will be lost in the coming months, and the unemployment rate will rise to a record 13% in June, from a 50-year low of 3.5% in February. Already nearly 17 million Americans have sought unemployment benefits in the past three weeks, dwarfing any period of mass layoffs recorded since World War II.

Gregory Daco, chief U.S. economist of Oxford Economics, projects 27.9 million jobs will be lost, and industries beyond those ordered to close will account for 8 to 10 million, a level of job destruction on a par with the 2007-09 recession.

Oxford Economics, a U.K.-based forecasting and consulting firm, projects April’s jobs report, which will capture late-March layoffs, will show cuts to 3.4 million business-services workers, including lawyers, architects, consultants and advertising professionals, as well 1.5 million nonessential health-care workers and 100,000 information workers, including those working in the media and telecommunications.

“The virus shock does not discriminate across sectors as we initially thought,” Mr. Daco said.

Gary Cuozzo, owner of ISG Software Group in Wallingford, Conn., said in recent weeks he’s only received a few hundred dollars in payments from customers, including manufacturers, nonprofits and retailers, for which he hosts websites and builds applications. It’s not enough to pay the $3,000 electric bill for his servers and other equipment, much less pay his own salary.

“Customers who paid like clockwork for 10-plus years are suddenly late,” he said. “I’m burning through all the cash I have.”

Mr. Cuozzo stopped drawing a salary several weeks ago, and has filed for unemployment benefits. He’s essentially volunteering in an effort to keep his business afloat. He can work at home or alone at his business, but that’s of little help. “We have no software projects,” Mr. Cuozzo said. “Everything is on hold.”

Those employed in industries where working from home is feasible are facing widespread layoffs, said ZipRecruiter Chief Economist Julia Pollak. The recruiting site itself laid off more than 400 of its 1,200 full-time employees at the end of March.

© Alyssa Schukar for The Wall Street Journal A survey of visitors to the job-search site found 39% employed in business and professional services reported they were laid off, nearly the same rate as respondents in retail and wholesale trade. (Active job seekers are more likely to be laid off than the average American.) Among the respondents who still had jobs, many in white-collar industries said their hours were cut.

“Any company that had been planning to open a second location, that hired an architect, an office designer, and contractor—they’re not opening that location this year and those people now won’t have jobs. Any company planning to go public this year, that hired accountants, consultants, PR professionals—they’re laying off all those teams,” said Ms. Pollak.

Law firms have had to reduce staff and cut pay as courts are largely closed, settlement discussions are on pause and few new deals are being struck.

New York City-based Cadwalader, Wickersham & Taft LLP, a 400-attorney firm specializing in financial services, has reduced associate salaries by 25% and partners are not currently receiving compensation. Firms typically lay off attorneys only as a last resort, but another New York-based firm, Pryor Cashman LLP, is furloughing some associates. A spokesman said it expects to recall them soon.

Baker Donelson, a 700-lawyer firm with some 20 offices in the southeast and mid-Atlantic region, has reduced compensation for associates and staff by 20%. Timothy Lupinacci, the firm’s chairman and chief executive, said some clients have asked the firm to stop work or defer payments. “Law firms are not going to be top of the priority,” he said.

How we work from home isn’t the problem, said Karen Richardson, executive director at the National Association of Women Lawyers. “It’s: Will there be work for us to do?”

While the coronavirus has strained emergency services and intensive-care wards, hospitals have been cutting the elective surgical procedures and routine care that normally pay the bills in order to free up resources.

“In a sense we kind of sacrificed that revenue for a public-health interest,” said Daniel Philbin, a cardiologist at the New England Heart and Vascular Institute in Manchester, N.H. “The hospital systems really are facing an incredible crunch because of this—the longer the curve gets pushed out, the more they face difficult decisions about employment.”

Emily Hill thought her job as a dental assistant was safe, being in an in-demand field and employed through the military. She worked as a contractor at a dental clinic on Fort Hood in Texas.

“I always felt untouchable,” she said. “This really puts you in your place.”

When word of possible layoffs began to spread in mid-March, clinic staff expected a week or two without pay. Employees jokingly shared a PowerPoint presentation on how to file for unemployment benefits. That document became essential when she and her colleagues were informed they’d be without a job at least through June 19. The military had given stop-work orders to all nonessential contractors on base to limit any risk they might spread Covid-19.

“It went from no big deal to ‘Oh my gosh, what the hell am I going to do?’,” said Ms. Hill, who is now collecting $320 a week in unemployment benefits. She and other laid-off workers are likely to see larger payments when states distribute additional federal funds.

Sandra Vigil, a bus driver for Loudoun County, Va., transported federal employees and other workers from suburban homes to Washington jobs. In the last weeks of March, ridership plummeted to only two or three people on her bus each day. The contract firm she worked for laid her off on March 27 after county officials sharply reduced the service schedule and related payments.

“To not be paid at all—that’s a shock,” said Ms. Vigil, 45, who supports five children at home. “We were thinking it would be reduced hours and maybe more safety training and maintenance work,” which is common during slow periods such as holiday weeks. She has applied for unemployment and was told she would receive $322 a week, but has yet to receive a payment.

State and local governments, who employ 20 million, aren’t immune. Unlike the federal government, they are generally required to balance their books every year. As tax revenue plunges, layoffs and other cost reductions become necessary.

State and local employment at first held steady during the 2007-09 recession thanks to federal stimulus, but from the recession’s end to mid-2013, it tumbled 700,000 as income and property tax receipts fell. State and local officials are again calling for federal relief to avoid cuts to services and payrolls.

Many municipalities have laid off hundreds of workers. Cincinnati Mayor John Cranley announced 1,700 city workers have been furloughed. “We’ve seen a massive drop in tax receipts and had to make some tough decisions,” he said. “It’s really emotional. No one wants to be deemed nonessential. Our employees want to help. But we need them to stay home.”

Laying off workers, and allowing them to tap enhanced unemployment benefits, effectively shifts their wages to the federal government, Mr. Cranley said. That cushions the city’s budget as it pays for additional overtime to police and paramedics and for the retention and deployment of nurses who had worked in schools.

The biggest wild card in the jobs outlook is how long it will take for jobs to bounce back, which depends heavily on how long the pandemic and social distancing measures last. The consensus among the economists surveyed by the Journal is for employment to return to its February 2020 level in 27 months, but views varied widely.

Economist Amy Crews Cutts, of AC Cutts & Associates LLC, expects the labor market to take 5½ years to fully bounce back. The sheer scale of job cuts so far, even if they don’t worsen further, are “an extraordinary number of jobs to reverse and put back into the economy,” she said.

One optimistic sign: Nearly half of workers who reported themselves as newly unemployed in March said they were on a temporary layoff, up from 29% in February. In Colorado and Washington, which require large employers to specify whether layoffs are temporary or permanent, 70% this year have been temporary. In the prior recession, less than 1% were.

Daiwa Capital Markets economist Michael Moran predicted many of those laid off will be recalled quickly, allowing the labor market to recover in six months. “The pre-virus economy was performing well,” he said. “Employers and workers will be anxious to return to normal.”

If restrictions on public movement are lifted later this spring, Moody’s Analytics economist Adam Kamins said the economy will regain about the half jobs lost to the pandemic by the end of the summer. But then the economy will operate more like it does in the middle of a recession.

“Industries that are subject to cyclical cycles, like finance, real estate and manufacturing, are likely to have layoffs,” he said. “The lockdown may be over, but there’s likely to be a prolonged period of stagnation.”

That’s the scenario haunting Eric Maynard, president of Baltimore-based Event Tech, which produces events such as conferences and university graduations. He said he’ll have to bring the 11 employees he laid off in March back in stages because the company will deplete all its cash reserves. He expects it will take months for customers to feel confident they can stage large events.

“Most will wait until it’s clear before they even start planning—if they can afford to do so,” he said. “We don’t know when the work will pick up. That’s the scary part.”

The longer unemployment stays high, the greater the hardship, as health insurance and unemployment benefits run out. Joblessness also becomes harder to escape as a worker’s skills and experience become obsolete.

Darin Caster had regularly performed his information-technology job from his Omaha, Neb., home. He was laid off on April 2 after the pandemic caused a sharp drop in sales at the sporting-goods retailer he worked for the past nine years.

Mr. Caster, 54, said he would receive two months of severance pay, but he’s eager to find a new job quickly. His health insurance runs out at the end of the month.

“It was 10 years ago I was laid off in a similar situation” in the wake of the last recession, he said. It took him 10 months to find a new position then.