Peter and Nancy Rosalez found out in November they were eligible for up to $25,000 in government money to keep from losing their house to foreclosure.

But their mortgage company had gotten permission to foreclose on their Middletown, Ohio, home and was about to sell it. The money sat unused while an auction of the home went forward.

“The mental anguish we’ve been through with this house and trying to save this house—it’s just been ridiculous,” Mrs. Rosalez said.

The federal government allocated funds for distressed homeowners as part of its expansive efforts to help Americans cope with the pandemic’s financial strains. Unlike some other stimulus programs, such as checks mailed to individuals, this money moved slowly.

The nearly $10 billion Homeowner Assistance Fund was administered through the U.S. Treasury Department, but relied heavily on individual states to set up programs to distribute aid. Some were slow to get up and running. Others struggled with a backlog of applications. For homeowners, getting money before the foreclosure went through could be a race against time.

The money ultimately came through for Mr. and Mrs. Rosalez, but it came down to the wire. Expecting to be forced out of their home, the couple had packed up their belongings.

The Rosalez family packed up their belongings in boxes. They feared losing their house to foreclosure.

“The homeowner shouldn’t be fighting on two battlefronts,” said Jim Kowalski Jr., chief executive officer of Florida’s Jacksonville Area Legal Aid Inc. That was common during the previous financial crisis, when millions lost their homes, he said. “You learned this lesson.”

The fund doled out about $2 billion to more than 150,000 households through the end of September, according to the National Council of State Housing Agencies, a trade group. The money serves a narrow slice of the population: There were some 324,000 foreclosure filings last year, below prepandemic norms but more than double 2021, according to real-estate data firm Attom.

The funds were made available to homeowners who experienced pandemic-related hardships and whose household incomes were below a certain threshold. Most states gave the money as grants.

About 200 homeowners have complained about the program through the Consumer Financial Protection Bureau’s complaint portal, including a handful about foreclosures moving forward while they were waiting on assistance.

CFPB warned in March that foreclosing on a borrower who has a pending assistance application “will merit increased scrutiny.”

Government officials, as well as representatives of mortgage companies and states, said the assistance program has picked up speed, particularly in recent months, and everyone is working together. Servicers benefit more from taking the money than taking the home in a foreclosure, they said.

The program “has already provided much-needed assistance in all fifty states to over a hundred thousand low-income families,” said Gene Sperling, who coordinates the rollout of the Biden administration’s 2021 relief package, in a statement.

Servicers must pause foreclosure proceedings for 60 days when a homeowner with a Fannie Mae or Freddie Mac loan applies for funds. But they don’t have to do so for Department of Veterans Affairs loans and other government-backed mortgages. A group of federal agencies urged servicers to halt foreclosures for pending applications in such cases but stopped short of requiring it.

Mr. and Mrs. Rosalez had paused payments on their VA mortgage in 2021 under a Covid forbearance program. Conversations about a loan modification with their mortgage servicer, a unit of MidFirst Bank, didn’t result in a deal, according to Stephanie Moes, their legal aid attorney. The bank filed to foreclose in early August, and a court granted the request the next month.

Mr. and Mrs. Rosalez learned they were eligible for federal aid in November, just before the scheduled sheriff’s sale of the house.

Family photographs, artwork and other belongings sit in piles of boxes, which have overflowed into the family garage.

The couple filed an application in early October to Save the Dream, the Ohio program run by the state’s housing-finance agency to distribute homeowner aid. They learned they were eligible for the program in November, just before a scheduled sheriff’s sale of the house.

Mrs. Rosalez emailed their eligibility letter to the bank. The sale went ahead and the bank was the winning bidder, which would allow it to evict the homeowners. In late December, Mrs. Rosalez called the bank’s law firm. “If you have a heart, please reinstate us and let us get all this right,” she said in a message.

After The Wall Street Journal contacted MidFirst in early January, the bank asked the court to rescind the foreclosure, which was approved. A spokeswoman for the Ohio Housing Finance Agency said funds are being applied to reinstate their mortgage and cover up to six months of future payments.

“Once we learn someone has been approved for HAF, our policy is to take action immediately, including as appropriate initiating the process to rescind foreclosure,” a spokeswoman for MidFirst said.

Defenders of the program say states like New York and Texas are running smoothly.

That isn’t the case everywhere, though. 

William Steinwedel, an attorney at Maryland Legal Aid Bureau, said one of his clients lost his home during a monthslong wait for assistance.

In New Mexico, some homeowners are waiting months just to receive confirmation that their applications have been received, according to Eric Sutton, an attorney at the Albuquerque nonprofit United South Broadway Corp.

“There are some states that are taking an alarming amount of time,” said Stacey Tutt, an attorney who coordinates homeowner assistance at the National Housing Law Project.

The foreclosure on Mr. and Mrs. Rosalez’s home was later rescinded and they were told the aid money would be applied to reinstate their mortgage.

Homeowners who get approved after a lengthy delay might find their unpaid debt has gone up meanwhile, forcing them to use more assistance money to get their loans back on track, Ms. Tutt said. Because the fund has a fixed amount of money, that means less for other applicants. Some haven’t been able to use the money at all.

Christopher Elia started the process for homeowner assistance on his Orange Park, Fla., home in April, soon after his mortgage company filed for foreclosure. “I stressed every day,” Mr. Elia said. “I was afraid to answer the door.”

In October, he was approved for up to $50,000 in assistance. But because of missed payments and the servicer’s attorney fees, he owed more than $54,000 to reinstate the loan. Mr. Elia said he wasn’t able to come up with the additional money. The $50,000 went unused. 

Marissa Vetter, Mr. Elia’s housing counselor at Jacksonville Area Legal Aid, said she believes he could have used the assistance money if the unpaid debt hadn’t ticked higher while Mr. Elia waited.

A spokeswoman for Florida’s Department of Economic Opportunity, which administers the state program, said Mr. Elia took three months to finish his application, delaying the process. Mr. Elia said he submitted his initial application promptly, but additional requests from the state delayed its completion. Weeks would pass in between requests, but he provided information as soon as he could, he said. 

The spokeswoman for the Florida agency defended its handling of aid applications, saying the state “stretched every available dollar to serve as many homeowners as possible.”

To reinstate his loan, Mr. Elia agreed with the servicer to extend the repayment term from 14 years to 40 with a higher monthly payment. He is hoping to get money from the program to cover some payments on the modified loan.

A spokeswoman for Mr. Cooper Group Inc., the parent company of Mr. Elia’s mortgage servicer, RightPath, said the company continues to work with him.

Mr. Kowalski, of Jacksonville Area Legal Aid, wrote a letter to federal regulators in November hoping to draw attention to Mr. Elia’s case. “You must do better,” he wrote.