No matter how good any secret service or police force is, they will never be perfect. When you have many moving parts to oversee, eventually something evades detection that should have gotten noticed. If you are going to live in a nation that allows access to guns, as well as sniper and assault style weapons, sooner or later these things will happen. That's not a political statement, it's just logical deduction.
There will always be an element of society that will justify in their mind the actions they take, even though it is against the law. If they have the means to carry out their agenda, they will try. The defense can be exemplary, but it only takes once. The larger the crowd, the easier it can be to blend in.
Doing an autopsy on what went wrong is of vital importance, but unfortunately every future situation will be different (Other cities, other crowds, and other surroundings). The SS has been protecting heads of state for 200 years, but the unthinkable happened with Lincoln, and I expect, no matter what we do, sadly, it will happen in the future.