A lawyer for Mr. Sawyer, Kelly Green, said that common sense — not just legal precedent — would argue that Mr. Sawyer’s acts did not add up to attempted murder, a crime that can carry life in prison.

“Jack simply had thoughts about committing these crimes, wrote in his journal about committing the crimes, wrote his fantasy plans, and he purchased a gun,” Ms. Green said. “The average person on the street can understand that all of that is not good, but it’s not an attempted murder.”

The first signs of a problem in Fair Haven appeared on Feb. 14, an afternoon when images of the school shooting in Parkland were beginning to spread across the nation’s televisions. A parent told the police that Mr. Sawyer, who had left Fair Haven in 2016, had returned and had bought a gun. In court documents, police wrote that they knew Mr. Sawyer had made threats against the school two years earlier, but did not see evidence of anything new, and decided not to hold him at that point.

A day later, a teenage girl warned the police that Mr. Sawyer had described the Parkland shooting as “fantastic,” and wrote to her, in a Facebook message, “Just a few days ago I was still plotting on shooting up my old high school.”

With that, the police detained Mr. Sawyer and questioned him for hours. They said they seized a shotgun, ammunition, the journal and books about the massacre at Columbine High School from his car. According to a police affidavit, Mr. Sawyer told them that he had left a residential program where he had been getting treatment for depression and anxiety and that he had stopped taking medication that was prescribed to him. The police said he also told them that he intended to carry out a shooting at his former school.