We have to change the calculus for these dip shits who do this. They are not psychotic and out of control. They are very much in control and calculating almost every time. So... If you commit an act of homeland terrorism like this, your parents/spouse/roommate/adult children whom you live with are automatically arrested and charged with accessory. There are signs before these people do these things. This is medieval type barbarism we're talking about. If we arrest those over 18 living with the perp and we turn their lives upside down as we investigate any and all connections to the crime (who bought the gun, who knew about the gun, etc.), then possibly some of these killers think twice.
Only if the family member has documented proof that they tried to get help do they get let off the hook. But then we go immediately after the professional who dropped the ball. Watch how fast things change then. We'd almost HAVE to ban the guns to prevent the entire mental health profession from unraveling from lawsuits, arrests, etc.