The last breakdown of Marcus Gomez began in full view of the people whose job it was to stop it.

First, Mr. Gomez, a slight 45-year-old who was homeless and had long lived with schizophrenia, started hearing voices. Then he stripped off his clothes and stalked naked through the halls of his transitional housing program. Finally, according to his treatment notes, the voices overpowered him: They were telling him to kill the program’s staff.

Afraid for their safety, the program workers asked a nearby hospital, Long Island Jewish Medical Center in Queens, to admit Mr. Gomez for inpatient care. Once stable, he might continue treatment, perhaps even find permanent housing.

But the hospital did not stabilize him. Instead, hours after receiving him in July 2018, it discharged him into the night. Still psychotic, he drifted across New York City to his grandmother’s apartment in the Bronx, seized a kitchen knife and, swinging wildly, set upon her home health aide, stabbing the 62-year-old caregiver in the head, chest, armpits, arms — 37 times in all.

“My mind made me do it,” Mr. Gomez told the police when they questioned him. The caregiver barely survived. Mr. Gomez went to jail.

Even in a city where encounters with unstable homeless people have become a part of daily life, the shocking act of violence that Mr. Gomez carried out was unusual. But the circumstances that allowed it to happen were not.

For years, the social safety net intended to help homeless, mentally ill people like Mr. Gomez — and keep them from unraveling violently — has failed in glaring and preventable ways. Yet rather than be held accountable, a New York Times investigation has found, city and state agencies have repeated the same errors again and again, insulated from scrutiny by state laws that protect patient privacy but hide failings from public view.

Violent attacks by homeless, mentally ill people are relatively rare. In fact, mentally ill people are more likely to be the victim of a violent crime than to commit one. But each act of violence — every subway shoving, stabbing or slashing — can shake the city’s psyche.

The January 2022 killing of Michelle Go, a financial consultant who was shoved in front of an oncoming subway train, stirred public outrage and led to official promises of reform. But before all that, the man who killed her had been hospitalized at a state psychiatric facility and released despite signs that he was still delusional — the same kind of institutional breakdown that has preceded scores of other attacks, The Times found.

Times reporters spent more than a year examining how often homeless mentally ill people under the care of the city have committed acts of violence. There is no official accounting of such incidents, but The Times set out to create its own, scouring court filings, police records and news reports to identify more than 130 acts of violence carried out in recent years by people who were homeless and mentally ill.

The reporters scrutinized each case, conducting more than 250 interviews, obtaining tens of thousands of pages of confidential treatment records and visiting courthouses, jails, prisons and a psychiatric ward. The lack of public information about the incidents made it difficult to evaluate about a quarter of the cases. Still, the examination identified 94 instances in the past decade in which breakdowns of the city’s social safety net preceded the violence, sometimes by just days or hours.

The review focused on the major elements of that safety net — a disjointed patchwork of homeless shelters, hospitals and specialized teams that was stitched together after the state began closing its notorious psychiatric institutions in the 1960s. It found a widespread failure by the agencies to share information, even though the state created a detailed database expressly for that purpose. It also revealed a pattern among the agencies of taking the narrowest possible approach to care, and an unwillingness on the part of city and state officials to fully fund crucial programs, leading to understaffing and harried treatment.

Each of the cases examined by The Times was its own portrait of individual suffering. A bipolar man who was kicked from one shelter to the next while in the grips of a crisis. A young mother who was still unstable when she was cut loose from an emergency room. A 23-year-old whose outpatient treatment team stood by as he became increasingly violent, doing little to intervene. Taken together, the 94 cases offer the fullest picture yet of how, where and why the safety net has broken down.

The breakdowns occurred most frequently in the city’s homeless shelter system, which in recent years has spent more than $1 billion on dedicated mental health shelters but failed to reliably place mentally ill people in them. One man whose history of delusions should have landed him in such a shelter was instead placed in a general shelter last year before he deteriorated and stabbed three other homeless men, killing one of them.

Next were the city’s private and public hospitals, which have regularly discharged people in severe psychiatric distress. Private hospitals, in particular, have cut psychiatric beds to boost their bottom line. Public hospitals have repeatedly erred while being overwhelmed by nearly 50,000 psychiatric patients per year. At least some of the discharges documented by The Times appeared to violate a federal law requiring hospitals to stabilize patients before releasing them.

A network of special treatment teams was supposed to be New York’s solution for caring for high-risk, mentally ill people on the streets, but more than a dozen cases identified by The Times occurred on the watch of such teams. The failures took place as the state has starved the teams of funding, leading providers to pay caseworkers low wages and saddle them with staggering caseloads. Some teams spent just 15 minutes per visit with patients — the minimum amount of time required to bill Medicaid for services.

The remaining cases involved people who appeared to have been failed by the jail, prison and parole systems and other agencies.

The killing of Ms. Go horrified a city still emerging from the depths of the coronavirus pandemic, and Mayor Eric Adams responded by urging the authorities to step up involuntary hospitalizations and by ordering the dismantling of homeless encampments.

In doing so, Mr. Adams became the latest in a line of city leaders to grapple with how to treat homeless mentally ill people, who flooded the streets when the state began shuttering its mental institutions. Each administration attempted its own fixes, met with limited success and then passed the problems on to the next one.

“The public has been gaslit for nearly four decades,” said Mary Brosnahan, who spent 30 years leading the Coalition for the Homeless, a New York advocacy and service organization. “We keep being told something is done, but nothing has changed. There is constant finger-pointing at every level of government and dropping the ball with the hopes that it won’t result in another Michelle Go.”

Mr. Adams declined to be interviewed for this article. In a statement, he said that addressing the mental health crisis was a top priority.

“After decades of past administrations ignoring this crisis, we are not going to continue walking by those who need help,” he said, citing plans to add resources and training and improve coordination among agencies. “This is our moral mandate as a city, and we will not fail to deliver for our most vulnerable.”

The agencies that run the city’s homeless shelters, hospitals and mental health programs refused to answer questions about failures in specific cases, citing patient privacy laws.

Asked about Mr. Gomez, for example, a spokeswoman for Northwell Health, which runs Long Island Jewish Medical Center, declined to discuss his discharge, but said: “Northwell Health takes all such decisions seriously and is fully committed to ensuring the health and safety of our patients.”

The agencies declined to discuss the failures even when provided with signed privacy waivers.

Representatives of the agencies said they were doing their best under difficult circumstances.

“No one piece can fix the whole thing,” said Ann Marie T. Sullivan, the commissioner of the New York State Office of Mental Health, adding: “I think we’re on a path here to provide some really good community-based care.”

For her part, Gov. Kathy Hochul announced plans earlier this year to put $1 billion toward reversing years of disinvestment in the mental health care system. She said this month that more than half of the promised funding had been committed.

The intertwined problems of homelessness and mental illness are some of the most intractable social issues in the United States, and ones that no large American city has fully figured out how to solve. Even robust and well-funded mental health programs have failed from time to time, given the challenges posed by consistently getting treatment to people with no fixed address or support system.

The acts of violence examined by The Times were committed by people who ranged in age from 19 to 83 and had been diagnosed with schizophrenia, bipolar disorder and other serious illnesses. All but seven were men. Most were Black or Hispanic and, like others from those communities, had faced racial bias and other barriers to receiving quality care. It was only after they committed serious crimes and entered the criminal justice system that many of them got consistent treatment.

The failures of New York’s social safety net have caused harm not only to the homeless people themselves, but to the dozens of people who crossed their paths in the subway or on the streets. The ones who survived emerged from the encounters with lifelong physical or psychological injuries. The ones who did not left gaping holes in families and bitter resentment toward a system that has not learned from its mistakes.

Before he attacked a stranger, before the blur of the subway station and the arrest that followed, Jamar Newton walked into an aging brick building on East 30th Street in Manhattan and entered the city’s sprawling homeless shelter system.

Run by the Department of Social Services, the system consists of nearly 600 sites across the city that are operated by nonprofits on a contract basis. It houses some 80,000 people per night. Newcomers are supposed to be assessed and routed to shelters that meet their needs. Among the options are 37 specialized mental health shelters that offer treatment — at a cost to taxpayers of about $250 million a year.

The mental health shelters are staffed with psychiatrists and social workers who can provide care and support. Although the facilities have had their own serious problems, they represent one of the most intensive options available to mentally ill people in the shelter system.

But The Times found that the city has regularly failed to put desperately ill people in those specialized shelters, shuttling them instead to facilities where services are minimal and psychiatric problems can go unaddressed.

One reason traces to a shelter intake process that relies on low-paid workers who lack the mental health training and the tools to identify psychiatric issues. Even though New York created a database known as PSYCKES years ago for sharing the mental health information of people who rely on the safety net, health privacy laws bar many of the workers who place people into shelters from accessing it. As a result, the workers must rely on their own judgment, and many of the assessments are incorrect.

When Mr. Newton, then 41, was being evaluated by a shelter worker in spring 2021, he was in denial about his illness. He simply answered “no” when the worker asked if he had ever been diagnosed with a psychiatric disorder, and she took his word for it, records show.

She did not know his history — that he had been a bright kid from Maryland with a wicked sense of humor before bipolar disorder got the better of him. That he had cycled through jails and psych wards for years. That treatment notes obtained by The Times showed he had sometimes displayed “psychotic features” in prior years and had once told a counselor that he had “trouble controlling violent behavior.”

In Mr. Newton’s assessment notes, the worker rated the likelihood of his having a mental illness at zero. A psychiatrist who worked with the shelter system and sometimes made placement recommendations did not flag mental health issues either, noting that Mr. Newton had denied any psychiatric history. He was sent not to a mental health shelter but to a different type of shelter, run by the Doe Fund in Brooklyn.

Within days, Mr. Newton was standing in the hallways and screaming with such intensity that shelter workers called the police. Soon after, records show, he got into a fight with another resident. By that summer, he had threatened to “put a bullet” in the head of a shelter supervisor.

“Mr. Newton would be better suited with a higher level of care than we can provide and is a danger to himself and to others,” a shelter worker wrote in case notes on file with the city in July 2021.

But rather than send Mr. Newton to a mental health shelter, the Social Services Department transferred him to another shelter that was ill-equipped to handle him, run by Project Renewal. When he attacked residents there, the department transferred him again, to a shelter run by Samaritan Daytop Village in Brooklyn.

A spokeswoman for the Social Services Department did not answer questions about Mr. Newton’s shelter placements. She said that the department was not a health care agency, that it cannot force clients to receive psychiatric treatment and that it tries to get residents mental health services regardless of where they are placed.

Over the next month, as his untreated paranoia intensified, Mr. Newton began carrying a hammer wherever he went.

In August 2021, wandering a platform in Manhattan’s Union Square subway station, he pulled the hammer from his bag and used it to crack the skull of a 44-year-old stranger, sending him tumbling onto the tracks. Bystanders pulled the man to safety as Mr. Newton fled. The police caught him in Harlem the next day.

“My mind was unstable,” Mr. Newton told The Times in June, before being sentenced to eight years in prison. “I didn’t take the time for myself to get in line to talk to someone or get my meds.”

Such sorting mistakes were not isolated incidents, according to a 2022 audit by the state comptroller. One in four severely mentally ill people in the shelter system had not been placed in a mental health shelter, the audit found.

Some of those who were placed in less-intensive shelters went on to kill themselves or others, The Times found.

Trevon Murphy, for one, was placed in a general shelter in Queens despite a history of paranoia and delusions, according to records and interviews. Within months, in summer 2022, Mr. Murphy, 40, crept up to three homeless men as they slept on the streets around Manhattan and plunged a large serrated knife into their bellies, killing one and leaving the others grievously wounded. He was arrested and is awaiting trial.

When homeless mentally ill people begin to unravel, often their first stop is the nearest hospital — where they are both a patient in need of treatment and a cost unit.

And for years, the economics of the health care industry have made it more difficult for them to get the care they need.

Urged on by state officials who regarded the hospitals as too bloated and costly, privately run hospitals in particular have cut inpatient psychiatric beds, which are expensive to operate and net less revenue than beds for other types of patients. There are now nearly 2,700 such beds in private and public hospitals operating across New York City, down from more than 2,900 in 2010.

Bed closures have also been spurred by federal policies that discourage keeping people for long-term mental health care by reducing reimbursement rates from Medicaid and other insurers. Hospitals earned just $88,000 in net patient revenue per psychiatric bed in 2018 compared with $1.6 million per bed for all types of care, according to a 2020 report by the New York State Nurses Association.

New York’s private hospitals — which run the overwhelming majority of the city’s emergency rooms — have sometimes resisted admitting patients who rely on Medicaid rather than private insurance. Even though federal law requires emergency rooms to evaluate and stabilize all patients, doctors in private hospitals routinely discharge homeless patients in psychiatric distress, according to more than a dozen care providers and lawyers who specialize in mental health care cases. Some of the doctors do so out of the belief that the homeless people are faking symptoms to secure a place to sleep, records and interviews show.

When Michael J. Jones walked into the emergency room at Mount Sinai Beth Israel hospital in Manhattan, pushing a shopping cart filled with his belongings, he pleaded with a doctor to admit him for inpatient care. Mr. Jones, then 34, had been taking psychotropic medications for the past 12 years and in recent months had been in and out of at least three different psychiatric wards. At that moment, in March 2017, he said, he was depressed and felt like killing himself or someone else, records show.

But rather than admit Mr. Jones, the doctors conducted a brief “psych consult,” gave him an anti-inflammatory drug for back pain and kicked him out.

“Upon discharge, patient refused to leave stating he was suicidal and homicidal but behavior was deemed to be manipulative,” his treatment notes read. “Security was called to escort patient out.”

A representative of Mount Sinai declined to comment.

Hours later, Mr. Jones was wandering the streets when police officers approached him in East Harlem. Still unstable, he punched one of them in the face, bit another and head-butted a third, saying later that he had hoped they would kill him. He was sentenced to 10 years in prison.

“I went to the hospital to get help, and they denied me,” Mr. Jones said in an interview. “They thought I was homeless and just looking for a bed to sleep in. I didn’t need a bed — I needed help.”

As private hospitals have moved away from caring for homeless mentally ill people, they have placed a disproportionate burden on the city’s public hospital system, NYC Health + Hospitals.

The largest municipal hospital network in the nation, it has a budget of nearly $10 billion a year and runs 11 hospitals citywide. Even so, it has buckled under the strain of treating 47,000 psychiatric patients per year.

In interviews, doctors at the public hospitals described operating in a near constant state of triage, having to make split-second decisions about who could safely be cut loose.

“The volume of patients we see is so high, and the science is inexact,” said one doctor, who spoke on condition of anonymity for fear of repercussions for speaking candidly. “We are operating with our own biases and threshold of risk, and sometimes people slip through the cracks.”

One of those people, then 29-year-old Luz Sanchez, was clearly unwell when paramedics brought her to Harlem Hospital Center in January 2021: She had assaulted her boyfriend and was ranting so violently that an emergency room doctor gave her a sedative “due to concern for safety of patient and staff,” her treatment records show.

Diagnosed with schizoaffective disorder, she had repeatedly assaulted family members and more recently had taken to attacking strangers on the street. The medical records available to the emergency room doctor, Avinash Viswanath, showed a history of attempted suicide and psychiatric hospitalizations, but it was unclear whether Dr. Viswanath reviewed them. He declined to comment.

As an emergency room physician, he was empowered to order Ms. Sanchez held for up to two weeks if he determined she was at “substantial risk” of harming herself or someone else. Instead, after sedating her, and less than an hour and 20 minutes after she arrived at the emergency room, Dr. Viswanath ordered her discharge, justifying the decision by citing a need to respect her rights. Two weeks later, she pushed a 54-year-old woman onto the tracks of a Bronx subway station, injuring her. Ms. Sanchez was sentenced to two years in prison.

When homeless psychiatric patients are admitted, the state’s Medicaid policies can affect what happens next. Under changes enacted in 2010, hospitals that treat psych patients for longer than 12 days are reimbursed by Medicaid at lower rates. That can lead to internal pressure to discharge patients even if they are still unstable, records and interviews show.

After becoming psychotic and defecating and urinating in the hallway of his mother’s apartment building, Darrell Johnson got a bed in the psychiatric unit at Jacobi Medical Center in the Bronx in October 2021. He was still unwell nearly three weeks later when a doctor at the hospital, Emily Urbina, informed his outpatient treatment team that he would be discharged.

Mr. Johnson, then 28, had been ill for so long that he had barely ever held a job. He had been hospitalized at Jacobi seven times for psychiatric problems in the preceding two years, and had just spent more than five months at a state psychiatric institution.

The leader of Mr. Johnson’s outpatient treatment team said she urged Dr. Urbina, who had seen him less than a year earlier, to help have him admitted to a state facility again. The leader, Donna Freund, noted that he was not yet stable and condemned the decision to discharge him as unsafe and “outrageous.” The doctor went through with it anyway. He was taking his medications, she said, according to records, and there was no safety risk in letting him go.

Six weeks later, Mr. Johnson approached a 50-year-old woman on Manhattan’s Upper West Side and punched her in the face with such force that it left her with a disfiguring injury, the police said. Then he punched another woman a block away.

“What he did to this woman likely would not have happened if they had kept him in the hospital,” said Ms. Freund, a licensed social worker.

Dr. Urbina did not respond to requests for comment.

Mr. Johnson is now in jail and awaiting trial.

A spokesman for NYC Health + Hospitals said the system offers high-quality care and never discharges patients based on financial considerations. He did not respond to questions about Ms. Sanchez and Mr. Johnson, citing privacy concerns.

There was a time in New York when tens of thousands of mentally ill people were warehoused in state institutions, and often subjected to abuse, neglect and degrading conditions.

But riding a wave of reform in the 1960s, state officials began a decades-long push to empty the institutions and raise in their place a robust system of community care.

In the following years, as thousands of people with mental illness became homeless in New York City, those officials broke their pledges of money and support. Most of the promised community health services never materialized.

In the 1990s, the state Office of Mental Health launched a new program to fill part of the gap. Called assertive community treatment, the program relied on traveling medical teams that were supposed to provide care equivalent to that of a “well-run mental health clinic.”

But the state gave the treatment teams just a fraction of the funding it had provided to its mental hospitals. Before deinstitutionalization, New York spent about $400 million a year on its psychiatric institutions, according to one estimate cited in congressional testimony in 1963 — the equivalent of about $4 billion today. The assertive community treatment teams, by comparison, have received, on average, about $120 million a year in state and federal funding in recent years.

Because the program is administered on a contract basis, nonprofit providers have felt pressure to keep costs down, former treatment team employees said. Many contractors who run the teams have underpaid their workers and sometimes failed to give them adequate training. Some have also given them unmanageable caseloads, The Times found.

When Nathaniel Evans, 51, started as a peer specialist for one of those teams, run by a nonprofit called CASES, in 2019, he shared a caseload of more than five dozen people, he said. One of his clients was a man named Elijah Muhammad.

Diagnosed with bipolar disorder and schizophrenia, Mr. Muhammad had drifted through shelters, hospitals and jails for years. He was prone to forgetfulness and sudden outbursts — he once punched out a car window — but still Mr. Evans saw in him a sweet kid who struggled mightily with demons he could not seem to shake.

It was often up to Mr. Evans to ensure that Mr. Muhammad was taking his medication, eating regularly and otherwise caring for himself. But amid the crush of the peer specialist’s other duties, it soon became clear that Mr. Muhammad needed more help than the team could provide. He would disappear for weeks at a time and turn up with no shoes or socks on, sleeping in a subway car. Mr. Evans tried to do what he could for him, he said, but it never seemed to be enough.

“I’m doing welfare checks, checking to see if they have food, checking their room and asking a series of questions to see how that person is in that moment,” said Mr. Evans, who was paid $38,000 a year for the work. “In 10 to 15 minutes, I’m gone.”

In a statement, the chief executive of CASES declined to answer questions about Mr. Muhammad, citing privacy requirements.

During one of his vanishing acts in June 2022, Mr. Muhammad punched a Brooklyn shopkeeper in the face. After his arrest, the treatment team pleaded with a judge to send his case to mental health court, which mandates psychiatric services in lieu of incarceration. But the judge sent him to Rikers Island instead. About a month later, Mr. Muhammad, 31, overdosed on contraband fentanyl and died. Rigor mortis had set in by the time the jailers discovered his body.

Mr. Evans, who had left CASES months earlier, was shaken.

“I did the best I could,” he said. “I didn’t come into this organization to watch people pass away unnecessarily. It’s a crushing blow.”

Not every member of a specialized treatment team has tried as hard as Mr. Evans did, The Times found.

After a prison stint, Justin Pena was connected in May 2018 to an assertive community treatment team run by The Bridge — a contractor that had been cited repeatedly by state regulators for losing patients, filing deficient treatment plans and failing to quickly address crises, records show.

Diagnosed with bipolar disorder and living in a mental health shelter in spring 2020, Mr. Pena appeared to be on the brink of breaking down. He demanded his psychiatric medications, but his refills had yet to arrive. He became enraged and assaulted another resident, according to records turned over in a criminal case against Mr. Pena.

Mr. Pena’s shelter workers asked his treatment team for help, noting it was essential that he take his meds. Sheryl Silver, a senior vice president of community support programs at The Bridge, replied.

“Getting meds today, tomorrow or Monday will have little impact on his violent behavior,” Ms. Silver wrote, according to the records. She declined to answer questions from The Times, citing patient confidentiality.

By that October, fearing that Mr. Pena might try to kill himself, the shelter staff asked the treatment team to check on him, the records show. But the team, which was supposed to offer round-the-clock support, said no one was available to visit on the weekend.

The next month, after Mr. Pena bit another resident, the shelter staff called a meeting with the treatment team to discuss his escalating behavior, and expressed concern that he had not been taking his psychiatric medications. But during the call, the treatment team members said they “had not noticed any concerning behavior,” the records show. They agreed to check on him the next day.

It was unclear whether the check-in occurred. But that same day, in November 2020, Mr. Pena shoved a 36-year-old man off a Bryant Park subway platform and onto the tracks, injuring him.

“A fuse blew in my head,” Mr. Pena, then 23, said after his arrest, according to court records. “When no one is helping me, I think negative thoughts.”

He was sentenced to six years in prison.

In a statement, the chief executive of The Bridge, Susan Wiviott, declined to discuss Mr. Pena’s case without his consent but strongly defended the organization’s record, saying its treatment teams provide quality care.

“Although the team members make every effort to sustain and support client participation in the program, we will never be 100 percent successful,” Ms. Wiviott said. “Our multidisciplinary staff work tirelessly, in clients’ homes, on the streets and in shelters to meet their needs.”

In another case, a homeless mentally ill man lashed out while under an even more robust form of treatment, known as intensive mobile treatment. It was created by the city in 2016 to ensure that the sickest and most vulnerable people do not hurt themselves or someone else. The treatment teams have smaller caseloads so they can be more nimble and are supposed to coordinate care between agencies.

The man who lashed out, Rashid Brimmage, was placed with an intensive mobile treatment team, run by Community Access, after an arrest in 2019. When a psychiatric nurse practitioner with the team met with Mr. Brimmage in the Bronx, it was November 2019, and he was wearing no shoes.

Diagnosed with schizoaffective disorder, he was psychotic and could not go more than a few hundred feet without cursing at strangers or sneaking up and touching them, his treatment records show. The nurse practitioner noted that Mr. Brimmage’s behavior put him “at risk for being both the perpetrator, and more likely, the victim of violence” and that he badly needed antipsychotic medication.

But Mr. Brimmage declined the medication, and the law barred the team from medicating him against his will.

Then the pandemic swept across New York City, and the mobile team lost contact with him. Mr. Brimmage checked himself into emergency rooms in the Bronx and Manhattan five times from April to June 2020, telling the doctors during one visit that he was hearing voices, the treatment records show. But the hospitals discharged him each time without notifying his mobile team — whose contact information was readily available in the hospitals’ internal database.

A week after his final hospital visit, in June 2020, he was psychotic again when he shoved a 92 year-old woman on a street in Gramercy Park, causing her to hit her head on a fire hydrant.

Mr. Brimmage was charged with assault and spent months in jail, until his case was diverted to mental health court last fall. He was sent to a residential treatment program but disappeared again, and his mobile team could not find him.

Then a Times reporter spotted Mr. Brimmage on a subway train in March. He was slumped in a corner, muttering to himself and wearing a bloodstained gray sweatshirt. A hospital bracelet dangled from his right wrist.

The reporter notified his lawyer, who immediately contacted his treatment team. The team tracked him down soon after. The chief executive of Community Access declined to discuss Mr. Brimmage’s case, citing his privacy, but said the organization has helped many clients find housing and get support.

Mr. Brimmage was returned to his treatment program, where he said he is focusing on his recovery.

“I’m here to change,” Mr. Brimmage said. “I have come a long way.”

Facing the same problems year after year, city leaders have fumbled to deal with people like Mr. Brimmage.

Mayor John V. Lindsay struggled to respond as thousands of mentally ill people landed on the streets in the 1970s. Edward I. Koch pressed to involuntarily hospitalize them in the 1980s. David N. Dinkins tried to rehouse them in the 1990s. Rudolph W. Giuliani ordered that they be arrested. Michael Bloomberg handed homeless people one-way plane tickets out of town. Bill de Blasio sank most of $1.4 billion into programs that did not address the needs of the most severely mentally ill.

It became Mr. Adams’s problem when Ms. Go was killed by a homeless man in January 2022. Responding, Mr. Adams cleared the streets of homeless encampments, as Mr. Dinkins had done. Like Mr. Koch before him, he announced a plan to hospitalize them against their will. He deployed the police to remove them from the subways, saying the days of sleeping on the trains “are over” — a statement that echoed words once spoken by Mr. Giuliani.

But for the people on the streets today, as it was for those who came before them, the tough talk, the proclamations and the pledges simply faded into the background.

On a fall day in 2021, one of them, Shoshannah Johnson, was in the throes of a psychotic episode when she happened across a toddler walking with her mother in the Bronx and suddenly shoved the child to the ground.

Two days earlier, Ms. Johnson and her lawyer said, she had been discharged from Lincoln Medical Center after a 10-day stay in the hospital’s psychiatric unit.

While on Rikers Island this past August, having fled a treatment program and picked up a drug charge months earlier, she paused to describe what it was like to be sick in a city that seemed unable to care for people like her.

“People think that it’s your fault,” Ms. Johnson said. “We can’t take care of ourselves.”

“I should have been off the streets a long time ago,” she added. “It shouldn’t be this hard to get stability and guidance.”

Andy Newman and Chelsia Rose Marcius contributed reporting. Susan C. Beachy contributed research.

Produced by Eve Edelheit, Eden Weingart and Dagny Salas.