You have multiple agencies working together with different radio frequencies and chains of command ... I assume.They're all on radios. As soon as one of them spots a threat it should go out on radio and those closest to Trump should have whisked him away out of danger. At the moment the guys on the roof were taking aim at the shooter, I think I should expect to see secret service agents rushing towards the president.
I'm not claiming any conspiracy theories that it was intentional. I'm at ease saying at this point that it just looks like a failure, until I know more.
If a member of the public notify a local cop that someone is on a roof it takes some time before the intel reaches someone from Trump's security detail.
And even more time before someone in charge decides to evacuate Trump.
It's not like local cop can talk directly into the ear piece of Trump's bodyguards who are right next to him, and give them orders.