I've been doing a little more light reading on stormtroopers, and I learned something quite surprising. In the Fantasy Flight RPG game, the stormtrooper stat line is the same as that of clone troopers. Clearly they're being treated as capable soldiers, but still minions for all that.
On that basis, if nothing else, I'd be inclined to say that stormtroopers are perfectly capable after all. Their problems can be explained by realism (real-life soldiers miss a lot more than you'd think), and plot armour in the vast majority of cases.
If anything, the famous and much-cited corridor scene in ANH marks the
Rebels as the mole-eyed incompetents. There were something like ten rebel troopers in that corridor, and maybe three or four managed to duck into the side door or retreat round the corner. The best I can suggest is that the smoke and blast from the door being blown open (which forced the rebels to look away) may have messed with their vision. It would also explain why the stormtroopers didn't throw a flashbang in; the door explosion did it for them.
That said, the Mandalorian does offer a couple of explanations for incompetent stormtroopers, both of which the video ignores AFAIK. During that scene with the two scout troopers, when one of the scouts shakes his blaster, it audibly rattles. Tvtropes had this to say;
It's also worth noting that one of the troopers shakes his pistol and it makes a rattling sound. As anybody who has dealt with precision weaponry can attest, loose parts inside a weapon is a sign that something is seriously wrong with it. This is also the explanation Star Wars Rebels used; Clone Trooper Rex complained that his marksmanship went in the toilet when wearing a shoddy Stormtrooper helmet.
https://tvtropes.org/pmwiki/pmwiki.php/ ... hipAcademy
The other one is much broader, and I got it from doing some reading on the Chinese Warlord period. Seriously, I can't help but think that this must have influenced Star Wars - at least via the early EU writers - because so many of the negative tropes associated with the Empire apply to the warlord armies. Chinese warlord armies were on the whole terrible; made up of whatever unfortunates could be lured or dragged from their homes, shoved into a uniform (if available), handed a rifle (if available) and herded into line. The warlords themselves were every bit as colourful, extreme, and in some cases downright psychotic as their Legends counterparts.
So in this case, Gideon's troopers are lousy because he needs numbers more than he needs quality. His troopers are whoever he could bribe, con, or force into his service; maybe given some brief flash training if only to make them obedient. Factor in shoddy equipment, and one should not expect too much of them.
As for the armour, the best I can suggest is that it's optimised for dealing with energy weapons - maybe some kind of heat-resistant ceramic - on the assumption that the primary threat they have to deal with is blasters; with countermeasures against other threats left out to cut costs. In short, stormtrooper armour is cheap and nasty.