Y'know, this is in this weird spot where it's right between canon and as seen (which, by the way, can be explained even with canonical things). If it was truly as seen, the shots would have gone way wide. If it was truly canon, the Reps would be scrambling for a new candidate now.
The explanation for Stormtroopers' shoddy marksmanship on screen in A New Hope is because Vader wanted Leia & company to escape, but by the skin of their teeth, so that they would basically drop their guard the instant The Falcon took off from the Death Star and not realise there was a tracker bug installed. If Vader just let them fly off unopposed, that would probably be hella sus, and they'd probably pull over at the first asteroid to find and chuck said tracker bug. So the Stormtroopers were specifically instructed to shoot to thrill, not to kill.
When faced with opposition without plot armour and reasons to keep them alive, Stormtroopers are fucking brutal, as seen in The Empire Strikes Back - Hoth was somewhere between a decisive Imperial victory and an Imperial Curb Stomp
When faced with opposition without plot armour and reasons to keep them alive, Stormtroopers are fucking brutal, as seen in The Empire Strikes Back - Hoth was somewhere between a decisive Imperial victory and an Imperial Curb Stomp
Their shooting was also terrible on Endor. Maybe those were the flunky storm troopers that got put on the imperial guard due to nepotism or corruption?
I suspect that any modern force ambushed in a jungle, or any type of complex, unfamiliar terrain, by primitive fighters who know the place like the back of their hands will suffer.
There are stories of UK soldiers in the sixties being ambushed by a man with a scimitar, and it took them a while and several fairly serious injuries before they could line up a shot with their FALs.
Not to forget the Vietnam war which, despite the advanced force being a coalition led by the US, and said coalition resorting to torching the jungle and other war crimes, still ended being up a North Vietnamese victory.
The Endor force, while not outgunned, was maybe outnumbered and definitely outwitted.
The storm troops on Endor were not ambushed. They knew the attack was coming. They were fighting from prepared defenses on a fire base. The fact that they were drawn out of the base to fight in the jungle was a lack of judgement on their part. Their whole mission was to protect the shield generator.