The PHB discusses how fighters are "well-rounded specialists."
What that means is that you're supposed to lean into your primary mode of attack, but when that isn't effective anymore, then you switch to whatever is effective.
So even if you took GWM and didn't take sharpshooter, you can still shoot a flying dragon with a longbow. True, you're not at your best, maybe not even at your baseline, but you're at least contributing.
If you have a shield of missile attraction, then you can have a mundane longsword and play the role of a proper tank against ranged attackers. Same with magic users and a spellguard shield.
That's not being well rounded. You're not doing well outside your specialization, You are just not Wizard-Terrible at it.
And with how Extra Attack is handed out like candy, there are over 5 other classes who are more well rounded than the Fighter.