If you want perfect balance in a game, play checkers. Expecting perfect balance given the nature of D&D isn't possible. You can come close, 4E probably came closest, but even then the abilities of the players, PC builds and the nature of the encounters could change things pretty dramatically.
In 5E, some classes are more effective at different aspects of the game at different levels, for different encounters, in different player's hands. Give two groups the exact same pregens and one group will likely be more effective than another. I don't think it's a problem, nor is it anything that needs to be "solved". I accept that if our party is being attacked by a horde of zombies approaching in a cluster that the wizard's fireball or the cleric's turn undead will be more effective than my melee fighter's warhammer. On the other hand, when my fighter can hold off that horde at a choke point while bashing in heads simultaneously giving everyone else a chance to clear out the ones in the back or when the casters are down to cantrips the balance shifts.
It's not perfect because perfection doesn't exist. But that fighter feels different from that wizard while still reasonably contributing on a regular basis. If I'm tired of one role or style I can switch to another with my next PC. The heck with perfect balance, I'd rather have flexibility.