Trusting to luck is not a strategy for the competent.
We got lucky the bomb didn’t explode. Sure.
It wasn’t “luck” that these departments did their jobs.
If they had overlooked this guy (ie. the 9/11 hijackers), you’d have a point. But blaming them for this would be like blaming a street cop for a mugging.