In The Two Towers movie near the end of the battle of Helm's Deep, the survivors barricade themselves before deciding to charge out "and meet them". For all they knew, it could have been their last ever push against the enemy. Usually, the most skilled and experienced warriors would take part and would likely lead the charge.
And yet Gimli was sent to sound the horn instead of riding with the others and offering support (especially since most of the Rohan army consisted of peasants). Did any of the producers explain this logic?
I'm ignoring the novel as, IIRC, Gimli retreated to the caves after Helm's Deep was overrun. So there are deviations between novel and movies.