100000000%
A lot of them dream about doing shit like this, especially if the protestors themselves are non-white or can be demonized as LiBeRalS.
It's definitely partly that. In fact, it's probably 50% that. But it's also more complex. We don't train soldiers to disobey orders, even if we technically tell them they should. In the moment, you follow orders. Not all lawful orders sound lawful at the time and not all unlawful orders sound unlawful at the time. Soldiers, by and large, don't hesitate to do potentially awful shit. This would be no different. If ordered to act, 99% of soldiers will simply act.
Then even if you allow for the existence of soldiers that would immediately be able to figure out this isn't right and is potentially a fully unconstitutional deployment of their weapons; you do what you're ordered to do because if you're the only one that doesn't, you spend the rest of your life in military prison.
The best parallel I have for you guys is Alberta Occupational Health and Safety laws. Follow me on this:
In -theory-, workers have the right to refuse unsafe work. At every level of training, workers are told not to engage in any work that will or may present a significant risk of injury. There's protocols to follow for reporting unsafe conditions and an entire food chain of people that can get involved if there's a dispute. Bottom line being; never do anything that has a reasonable chance of getting you hurt because you have the right as a free person to not die at work for the sake of someone else's profits.
HOWEVER...
Alberta law also makes construction work of ALL kinds a sort of 'at will' employment situation. My employees are construction workers by law. Which means I am legally entitled to fire them without cause at any time, regardless of how long they've been employed. So in theory they can refuse to do any unsafe work I ask them to do. In practice, I can just fire them for refusing and not give any reason why I fired them. And they know it.
The military functions much the same way. Yeah, don't follow illegal orders, but also you're not really entitled to determine was is a legal or illegal order and also we can throw you in prison forever without a public trial so good luck even proving whether you were right.