The impersonal machinery of bankruptcy has dealt a blow to Project Home's effort to build a $13 million LGBTQ-friendly affordable-housing project on property the nonprofit wanted to buy from the bankrupt North Philadelphia Health System.

NPHS received court permission Tuesday to reject agreements reached before the Dec. 31 bankruptcy to sell five parcels near Girard Medical Center to Project Home for $1.75 million.

That means that the nonprofit Project Home will have to attend a bankruptcy auction set for Aug. 11 to bid against potential buyers who want the properties for more lucrative real estate developments.

"This was not the path that we hoped for, but we remain optimistic," said Annette M. Jeffrey, spokeswoman for Project Home. "Delay on this project puts critically needed housing in jeopardy for 30 young adults who are homeless or at serious risk of homelessness. We don't give up when the need is so great."

Jeffrey said Project Home received more than 1,000 applications for only 88 units of housing at a separate residence at 2415 N. Broad St. that is opening soon.

Lawrence G. McMichael, a Dilworth Paxson lawyer representing NPHS in the bankruptcy, said Tuesday that he did not expect this outcome when a deal was struck in June to allow NPHS a month to see whether it could get higher bids for the properties that Project Home wants to buy.

"There were higher bids," McMichael said.

The bankruptcy process is designed to secure as much money as possible for creditors. In NPHS's case, secured creditors are expected to be paid in full, but it is not clear whether unsecured creditors, owed $29 million, will get much. The biggest unsecured creditor, Independence Blue Cross, is owed nearly $11 million.

A baseline bid of $10 million for NPHS's operations, which employ 575 and treat more than 1,000 patients daily, including 200 as inpatients, was made by Meridian Behavioral Health Systems LLC. However, Meridian's offer is laden with conditions that will make it hard for the Tennessee company with facilities in four states to close the deal.

Additional bidders have emerged that are strictly interested in the real estate at Eighth Street and West Girard Avenue.

At the auction, bidders will be able to make offers on three parcels: the main hospital, the parcels that Project Home wants to buy, and the combination of the two. Project Home will bid on the parcels it had agreements to buy.

The group led by Sister Mary Scullion, which has developed 714 units of housing for people who have been homeless or are at risk of homelessness, hopes its bid and an independent bid for the hospital could be combined to top a bid for all of the real estate.