Amusingly, this form of archery is traditional. It's like charging at the enemy with bayonets but loosing every round in your magazine before you get to them. Medieval accounts describe some battles as often becoming multiple simultaneous agglomerations of tightly-packed people engaged in absurdly close-quarters melees... but in these melees, bows were perfectly acceptable and quite common. Consider: if sledgehammers and throwing knives are typical, in infrequent, preferences in modern short-range sidearm combat, then it isn't too far fetched that, when facing an enemy whose fastest response to you throwing stuff at him be to sprint in your general direction, then of course a bow would be more favorable to the medieval infantryman than it would be to the modern infantryman.
Now, somersaulting over your enemy for a headshot probably didn't happen too often....
@TheLastTLK there was one skirmish in the Napoleonic wars where two batallions (or equivalent... maybe companies) were both wandering in thick and heavy fog. When, all at once, the fog cloud passed either party by, they found their respective foe approximately five feet away. A brutal melee ensued that had something to do with the capture of an Artillery post that was later abandoned after both companies retreated, though one company proudly proclaimed they had whooped their enemy. Pretty dumb but not as dumb as lining up, and definitely not as dumb as the final charge-at-a-walking-pace-against-an-opponent-outnumbering-us of the Old Guard uphill against incessant British fire.