After every multiple murder there is the usual criticism of why it wasn't prevented, particularly when the danger seemed so clear as with the recent murder spree in Buffalo. But, as has been said, everyone has twenty-twenty vision in hindsight.
Predicting suicide or homicide is not easy for, despite headlines induced popular belief, it is rare. While virtually all consider homicide or suicide at some point in their life, exceedingly few do, the risk factors being seriousness of intent, degree of control over behavior, the realism of the plan, and the availability of lethal means.
During my career, in a range of clinical settings, I have advised hospitalization for a literal handful of patients though witnessing many being hospitalized inappropriately, which can have a devastating personal effect. How is risk determined? By asking questions of the patient and family member(s), the doctor's conclusion deriving from their knowledge of human development and behavior. But the accuracy of this conclusion depends on the doctor's talent and knowledge, which varies greatly.
Once, while working in a general hospital, I spoke with a worried psychiatrist. His patient spoke seriously of killing the American President and the doctor didn't know what to do since the hospital was equipped for only short-term psychiatric stays so the patient must soon be discharged. I advised the doctor to phone the Secret Service. He did and they whisked the patient to another hospital. But these mental health decisions are not always so clear-cut nor are the appropriate facilities always available.