It seems insane, in retrospect, that Nikolas Cruz was allowed to buy any sort of gun, let alone an AR-15. With everything we know about the threats he made, and about the many police visits to his home, Cruz would appear to be the walking epitome of the unstable, dangerous character who would and should be told, "Sorry, bro."
And yet, up until the Parkland Hills shooting, he had committed no crime. He had sure as hell given signals he would, but he hadn't actually done anything. You say common sense suggests he'd provided more than enough reason to suspect he would do something awful if he got his hands on a gun, and no reasonable person would disagree.