This isn’t actually true, it may be true of ranged physical dps. But caster have historically hit on higher than melee dps do to the fact that cast times are a genuine mechanic like being in melee range.
Black Mage and Summoner were top 3 for all tiers of Heavensward except creator where Machinist was number 1, followed by SMN, MNK, than BLM. NIN and DRG had very potent utility and actually were the bottom 2 in that expac.
Stormblood was the same, SMN and BLM top tier dps over melee with red mage being lower than MNK and SAM but on par with dragoon. Even in ARR, BLM was a top tier dps. So historically, Casters have been the strongest role and in cases where that wasn’t true with MCH in 3.4/5(but was technically still a caster) it was reinstated immediately in 4.0 so this idea of melee being assured 2 slots because they are some how more challenging to play do to being in melee range isn’t true at all. The only reason melees were assured two slots prior to 5.0 was that disembowel was required for any serious group since ranged physical dps needed it and Nothing quite competed with ninja’s trick attack until patch 4.4 when Black mage got buffed so hard. Groups were cutting ninja for DRG BLM SMN BRD comps.
Likewise in 5.0, the only reason why you think melee are assured 2 slots is because SE over buffed the role but this game has always been designed with bring what’s good for you. The duty finder match makes 2 melee and 2 ranged because in ARR there were 3 melee dps and 3 dps that were ranged. That’s the ONLY reason why. Proof of this is evident when you look at the fact that ranged had cast times in heavensward because SE truly classified all ranged as range but now the distinction has been made where physical ranged and magical ranged are subsets of the dps role. Notice the raid finder matches you 2 melee(4 jobs) 1phys R(3 jobs) and 1 magical(3 jobs) this is because of it didn’t have this distinction, you would have 4 melee and 6 ranged possibly matching you with jobs that are missing certain role actions. you should also consider the duty finder would let you take 3 ranged all of which can be bard, raid finder is the one with a distinction and that came about in 3.3.
So this idea that melee was designed to have 2 slots isn’t true, there were just more melee than ranged physical and caster jobs during ARR and even then, it was usually just a product of buffs such as piercing, slashing, and trick attack
Tl;dr history has taught us this about the jobs
2.0 and 3.0 there are 3 melee and 3 ranged and both have equal representation (ranged magical and ranged physical aren't distinctions and don't matter)
4.0 is where the distinction happened, abilities like addle and refresh distinguished magical and physical ranged from each other as separate subsets. this is where the idea that ranged should do less than melee really took form but that only applied to ranged physical. the reason for this is because of 2 things
1. Ranged physical had more utility than any other role
2. ranged physical no longer had cast times that were designed to keep them inline with casters
(this is THE reason why ranged now do less as a design choice, it's because they have NO cast times, not simply because they can hit from a ranged spot. if what you are saying was true, then casters historically would also be weaker but casters has on average ALWAYS been the strongest and hardest hitting role. this changed when Red mage introduced hyper utility to the role and SMN's utility now had to hold wait in comparison to it and BLM but even then, all 3 on average hit harder than the other roles but magic damage isn't very strong in this game when compared to physical damage so this is likely the reason why they were on average very high up)
3.0, 4.0 and 5.0: Melee dps have historically had 2 slots because of the utility they brought, Disembowel gave dragoon a guaranteed slot for years until now and, Trick Attack is the most important raid buff in this games history. to this day jobs rotations are designed to accomodate it and lets not forget, NIN held a huge dominace do to it's enmity tools that no other job had in 3.0, and for a portion of 4.0.
5.0: all 3 subsets of dps have largely unique contributions thanks tot he role action system. furthermore, the party buff system means that SE wants at least 1 of each subset of dps represented in any given raid. thats it, the 4th slot is whatever your group wants to double down on, if SE wanted melee to fill that last slot. melee would have 2 party buffs for a total of 6 party buffs(Vit Dex Min Int and 2 Str) but thats not what it does, it's 1 per role. as long as you take at least 1 melee, the raid is performing as intended
feel free to check fflog statistics on older tiers as thats where i got the information on dps metrics.