Ok, let's ignore everything that happens above 10th level, for the reason you cited.
A 5th TWF level fighter (standard array) will have 16-17 STR or DEX, TWF fighting style and the dual wield feat. This fighter, using its attack and bonus actions, will make 3 attacks, with +6 to hit, each of them doing 1d8+3 damage. Against an average of AC 13, that's a DPR of 16,875.
Let's make a 5th polearm master level fighter (standard array). It will have 16-17 STR, defense fighting style (mostly chosen for ease of comparison) and the polearm master feat. This fighter, using its attack and bonus actions, will make 3 attacks, with +6 to hit, two of them doing 1d10+3 damage, one doing 1d4+3. Against an average of AC 13, that's a DPR of 16,875, the exact same of the TWF. They also have the same AC (dual wield vs defense style). The Polearm Master, however:
- has reach
- can make opportunity attacks when enemies enter its reach
- has a slightly more damaging opportunity attack, in general
- its action surge attack action does more damage
- if both characters find a single powerful magic weapon, the polearm master will benefit more from it
I'd argue the polearm master is ahead of the TW fighter, and would get more ahead if higher levels see play.
Let's try with an hypothetic greatsword user. It has have 18-19 STR (it picked ability score increase at 4th) and defense fighting style (again for ease of comparison). This fighter, using its attack action, will make 2 attacks, with +7 to hit, each doing 2d6+4 damage. Against an average of AC 13, that's a DPR of 17,6 slightly more than the TW fighter. They also have the same AC.
This Greatsword fighter, however:
- doesn't have to waste its bonus action every round. It can freely second wind without losing damage, for example
- has a substantially more damaging opportunity attack
- its action surge attack action does considerably more damage
- if both characters find a single powerful magic weapon, the greatsword user will benefit more from it
Only thing the TW fighter has over this greatsword fighter is, I believe, less wasted damage on overkills. I'd still pick this over the TW fighter everyday tbh (and so have all my players for almost 10 years of campaigns - rogue excluded ofc).
If I'm building the TW fighter wrong, please tell me, but what I'm seeing is it falling off as early as 5th level.
First? The main point is that what you're calling a massive difference is around a single point of DPR per round (correct me if I misread). When that accounts for 1-3% of the monster's total HP it's not particularly relevant. If you're hitting mobs of low level creatures, carrying over damage absolutely matters. I also think overkill comes into play, another thing not accounted for.
In addition, while back I was on a "I'm going to create monster database" for personal use before DndBeyond was released so I have a pretty extensive list of thousands of entries from the MM. The average for all levels is 14, but the picture changes if you break them down by CR. The average AC is 13 at CRs 1-4, but climbs to 19 at CRs greater than 16. The actual numbers: <5 = 13, 5-10 = 15, 11-16 = 17, >16 = 19. Of course you could also break those down by proficiency bonus, etc..
But then there are decision points. What attack ability modifier do you expect? Does the PC go for higher ability score or feat at 4th level? With TWF for example, adding to the ability is giving you a +1 to attack and damage. Dual wielder only adds +1 damage for going to a d8 weapon but it also adds +1 to AC (not to mention drawing two weapons at once). A lot of people ignore the defensive side of things. If you're going PAM (which I'd consider a variation of TWM) you have to take that feat at 4th and then somehow take into consideration extra opp attacks. Not sure how you do that. Finally, the extra bonus action may or may not matter depending on type of fighter.
The analysis for this is complicated and depends on many, many things. If I'm playing a tabaxi strength based fighter, I can just max out my strength until 8th level because I'm using my claws anyway. If magical swords are as rare as hen's teeth, a single weapon may make more sense. If magic weapons are relatively common but creatures immune to specific damage types are also common, a frost blade and fire blade combo for my dual weapon fighter may make sense.
Maybe someday I'll resurrect my fight program and try to figure some of this out because that's based on survivability not just DPR. I just think that spreadsheet analysis doesn't give you the whole picture. I can tell you that in Solasta, which tracks various stats over the course of a campaign, the TWF does better for every campaign I've run but that game has modified feats so it's not a direct comparison. Most of the time the TWF does better than even the casters, but that depends on the design of the specific campaign.