tbf, artillery was pretty inaccurate - by the time it was accurate enough to hit single individuals, sharpshooters were the bigger problem.
But yeah, there’s a reason why flag-bearers have such ridiculous casualty rates. “HERE, SEE MY BRIGHT COLORS WAVING ABOVE MY HEAD? I’M WORTH BONUS POINTS”
I mean, the thing is, artillery is generally pretty inaccurate up until a pretty late point. Even in the US Civil War, explosive shot was the exception, not the norm, and if you hit the unit you were aiming for, much less aiming for any particular rank or file, it was considered a good shot.
Famously, General Sedgewick exposed himself under artillery fire for a prolonged period, reassuring his men that the Confederate artillery couldn’t hit an elephant at the distance they were at.
… he was killed shortly thereafter, but by a hidden sharpshooter, not the artillery.
You might not be able to hit a soldier, but you usually can hit an army.
The flag just gives you something to focus on.
It’s like the urinal cakes. Just being there draws fire, even if it’s a college bar and they mostly miss the urinal.