Suppose you had a party of four players who all wanted to choose the same class, though possibly different subclasses. Which 5e classes would be best or worst for such a party?
Cleric. It's a solid class all-around, to begin with, it has plenty of sub-classes, some of which reach for quite different capabilities.
Similarly, the Bard has solid abilities and can poach spells from other lists, and pick up expertise. But, it's light on sub-classes.
The Druid is also a candidate as a base class (and I'm not just saying that 'cause it's my favorite 1e & 5e class), that can off-tank, scout a bit, blast, & do support - but it's also light on sub-classes.
Now, it's no accident I mentioned those three, they're the full-caster 'support' classes (healers).
An all-Paladin Party would be tough, hard-hitting and resilient, but it'd have limited versatility.
Wizards (and to a lesser extent Sorcerers or Warlocks) would obviously be very versatile and powerful, but a bit fragile (they could summon blockers of course) and would lack support capability. They'd probably also best be able to choose their battles and set their own pace.
The remaining classes would be viable only in campaigns limited in scope & pacing to match their capabilities. A party of mercenary Fighters in a long military campaign, lots of battles, with plenty of time between them for a short or even long rest in lieu of all that healing they don't have - and to use action surge and/or CS dice in as many fights as possible. Barbarians could excel in a few-encounters-a-day pacing thanks to their rage. Rogues could work well in a citified and social/exploration-heavy adventures, light on combat so lack of toughnesss & support doesn't hurt so much, heavy on skills and opportunism - Rangers, perhaps, in similarly-exploration-oriented wilderness adventures, combats could be intense, but infrequent. A cabal of Monks, each representing a different Order, exploring a metaphysical mystery and facing martial-arts tests on the way, might work - they could even be rivals who must work together, though, in the end, only one will succeed, winning honor for his Order? Of course, in the PH, none of them have all that many sub-classes.