They are the rare gun laws that attract bipartisan agreement — so-called red flag laws, which allow the authorities to temporarily take away guns from people declared by a judge to be too unstable to have them.

The case of Brandon Hole appeared, at first, to be exactly the kind of situation these laws were designed to address. Indeed, last March, when Mr. Hole’s mother raised alarms about his mental state, the police seized a shotgun from his home. It was never returned.

But a year later, the police say, Mr. Hole, 19, shot and killed eight people at a FedEx facility before killing himself, using rifles he had legally purchased not long after that incident in March 2020.

While many details are still unclear, Mr. Hole’s case is a sobering example of how even states with widely supported safeguards can fail to prevent dangerous people from obtaining firearms. The laws, experts say, are often used only as short-term solutions. In the days after the shooting, local officials have struggled to explain how a man who was deemed by law enforcement as too unstable to possess a weapon could go on to legally buy one months later.

“Any law is only as good as the people that are enforcing it,” said Brad Banks, a former prosecutor in Marion County, which includes Indianapolis, who is now in private practice. “Does it make sense we took away the gun because he’s too dangerous to have one, but we didn’t take the step to prevent him from going out and buying one the next day?

Red flag laws are in place in more than a dozen states, including Florida and New York. Their conditions vary widely; in California, for example, family members can directly petition to have firearms temporarily seized from their loved ones. But in Indiana, only law enforcement can initiate that process in court.

In March 2020, Mr. Hole’s mother approached officers at a Police Department roll call and told them she believed that her son was having suicidal thoughts and might even try to commit “suicide by cop,” the chief of the Indianapolis Metropolitan Police, Randal Taylor, said on Sunday.

The main concern at the time of the police visit, the chief said, was Mr. Hole’s comments “about killing himself or possibly even allowing us to kill him.” And so, the officers took the shotgun. It was never returned.

The seizure of weapons under red flag laws is often temporary. In Indiana, once a weapon is taken by the police, prosecutors have 14 days to justify the seizure to a judge. If such a determination is not made, the firearms are immediately returned. But if the judge decides the person in question is so unstable that he or she should not be permitted to have guns, the police hold onto the seized weapons, and the person is barred from possessing any guns for at least six months.

The permanent seizure of Mr. Hole’s shotgun would therefore suggest that prosecutors had sought and obtained a red flag determination. But this apparently did not happen. “For whatever reason,” Chief Taylor said, “that never made it to the court.”

Chief Taylor said it was not the police’s role to make the decision of whether to bring the case to court for a red flag hearing. The prosecutors’ office “would get a notification,” he said, that police had taken a weapon and that the owner of it had been expressing suicidal thoughts. It would be then up to that office to act, he said. “In reality, he may have qualified, but that is for the prosecutors” to determine, Chief Taylor said.

“What could have occurred,” Mr. Mears said, “is the point was: ‘Let’s get the gun out of there, make sure the gun is not returned,’ if that was the agreement that was made. And I’m not saying that it is the case. But there’s no reason to go in front of the judge at that point in time, because the point is we want to take the weapon away.”

For those who have studied the evolution of red flag laws, Mr. Hole may turn out to be a tragic example of their shortcomings. In practice, experts say containing more chronic threats like Mr. Hole might be beyond the laws’ reaches, in their current forms.