Whatever his other failings, President Donald Trump is unafraid to endure criticism in tossing out ideas most politicians would shun for fear of being scoffed at. His unfiltered nature sometimes leads to ridicule — Nuke the hurricanes? Really? — and sometimes offers the tantalizing prospect that he might be headed toward sensible action, such as when, after the Parkland, Fla., massacre, he suggested removing guns from those who clearly pose a threat.

In that instance, Trump’s “why couldn’t we” thinking was answered by the National Rifle Association, which made clear who controls Congress on the issue of guns. But in the wake of recent shootings, Trump took another try at addressing the link between guns and mental illness. This time he wondered aloud whether it makes sense to simply lock up those diagnosed as having the sort of instability that could lead to violence. In other words, bring back the asylums.

Maybe it was just the president’s “lock them up” gut reaction, but the idea seemed to resonate with some pundits and politicians. They must have short memories, because if the question is “why not?” the answer is: “Because we’ve been there before, and it didn’t work.”

In 1901, the N.H. Legislature passed a law creating an institution known as the New Hampshire School for Feeble-Minded Children. As envisioned, it would be a place children with mental disabilities could be placed, where they would get the care they needed while posing no threat — or inconvenience — to the public. It would also ease overcrowding at the state’s poorhouses.

The idea, initially, may have been proposed with the best of intentions. It may even be workable, under ideal circumstances. History, however, is littered with great theoretical ideas that proved unmanageable in practice. This was one of them.

Rather than getting the proper care, many of those admitted to what later became the Laconia State School were largely forgotten. The care they received at the severely underfunded and understaffed facility was, at best, maintenance. They weren’t helped to improve their lives; nor were they coached, treated and trained to function in society. They were there to live out their lives and die. By 1970, well over 1,100 people were housed there, lacking privacy and sanitary conditions, according to some reports.

That was a shameful chapter in our state’s history, one that came to an end only through court action. The state was sued on behalf of the “residents” — who might better be referred to as inmates — of the institution. The lawsuit, brought by parents of children at the school and advocates, including Dublin’s Jim Haddock — son of another famous activist, Granny D — eventually closed the school.

The plan, at that point, was to address the needs of those with mental disabilities in the community. The state would shift the resources used to institutionalize them to instead fund regional agencies providing help that might allow them to remain at home.

The same dynamic played itself out in the majority of states. Efforts are still underway to close the remaining “asylums” across the country in favor of localized care.

But just as the Laconia State School was underfunded and understaffed for decades, so, too, has been the state’s subsequent program. Those regional agencies, such as Monadnock Family Services, have seen their funding throttled — especially the Medicaid reimbursement rates through which much direct care is paid for.

Thus, the current system, while better and more humane, has also failed in some respects. One is that with no centralized solution and insufficient resources, too many Granite Staters — and those in other states — are ending up in hospital emergency rooms or incarcerated.

And, yes, some pose a threat. Instead of getting them the help they need, the president, and others, appear open to once again locking them away, rather than putting more resources into improving their lives.

We’ve seen how that goes. It isn’t the answer.