NYT's "The Daily" podcast discussed this a little over a year ago in response to the Parkland shooting, and I found it to be quite insightful. I believe it was this episode, but I could be wrong[0].
A major factor impeding law enforcement is the sheer number of people posting violent threats on social media. I can't remember the statistic, but they mentioned that the US justice system basically wouldn't be able to effectively process everyone in a timely manner that posted indications of violent activity on social media, it's just too frequent. It's easy to look back after a shooting and ask why law enforcement failed to see the warnings, but it's much harder to predict looking into the future. Simply posting angry threats on social media doesn't meet the threshold of committing a crime, but perception around that could be changing.
Another major issue is that this isn't a mental health issue, despite how it's characterized by politicians and the media. Deeply angry young men aren't mentally ill by any classical definition of mental illness; they're just really angry. They don't necessarily exhibit traits of schizophrenia or bipolar disorder; they're driven by hatred and anger, and that's just not something mental health professionals are equipped to diffuse.
0: https://www.nytimes.com/2018/02/23/podcasts/the-daily/gun-ac...