I did compensate for it, by forcing the greatsword fighter to throw javelins at the start of every other combat. Then we are comparing characters built for DPR, instead putting a DPR specialist against a defender. But fine; we'll do it your way... except that you still don't get a free feat. It's one thing to say that "ranged = +2 AC and opportunity attacks," it's quite another to say "range = +2 AC and opportunity attacks and a feat."Why are you trying to force the comparison with greatsword fighter when I started with sword and shield? Maybe we should start there?
Sword and Shield at least has significantly higher AC to offset the benefits of 120 ft range. Which is the reason I chose sword and shield. It's at least arguable that +2 AC and OA's is worth trading for 120ft range.
Greatsword would actually need to do more damage than the SS + CBE + Precision fighter to be comparable - so that the range component is compensated for.
Removing the "javelin rounds" and using sword-and-board, the duelist deals 178 damage per short rest. They can be brought up to the crossbow fighter's level with +1d6 on the weapon. Not 2d6.