I can't remember where it was mentioned, but Duty Finder has always tried to mix jobs and roles so that a balanced party is created. Now if that isn't possible, it then starts filling in just based on role. Ranged and melee DPS are not the same thing and it'll try to mix them so I'm assuming the imbalance of melee/ranged numbers is what causes the longer wait times. If there are less melee in the queue, they'll get in first to create those more mixed parties. DF also tries to mix up the tanks and healers the same way so that there's less class stacking.