First, as JiroPaiPai, FuriousHaunter, and AthenaBaer said - you don’t strictly need different actual classes - because character stats can fit them into different archetypes, because you’re having a character not just the game piece that is the unit, and because you might want a unit to be able to perform a similar role to another.
Second, if you’re seeking to actually correct the problem, after you have a few characters; instead pick classes and stat archetypes for units before thinking about them as the rest of your characters. Let me take FE7 as an example: Eliwood, Lowen, Rebecca, Dorcas, and Bartre are all units that don’t have excellent defenses out of the gate - so they are naturally complemented by Hector and Oswin both being extremely heavy units.
This approach might not be what you want! You might, because you think it’s neat or because it sounds fun, to have multiple units that are roughly interchangeable – and that’s fine too, because a big part of it is how you end up building the maps that those units go through.
Me, personally, I write out a list of what classes I have used so far and what archetypes those fulfill; and make sure to vary the weapon types and make sure the party has a good spread of stat profiles.
For example, if I have an Anima-wielding Lord with notably high Skill accompanied by a high-HP and Strength Axe cavalry; I’m going to want to have a Lance or Bow user to cover the “middle” ground, and a high Speed unit to complement how the first two beat Armors already so that weakness is not an issue.
A second example
For story reasons, I have:
Bow Lord, rounded stats but defensively lopsided to Resistance.
Cleric with high Magic.
A second Archer with high Strength and comparatively high Defense.
A thief, archetypical with middling strength high speed.
These really want to be complemented with a unit that has high HP for letting the Cleric’s larger heals be more useful, a source of magic damage, and a unit with high speed to dedicate to combat unlike the thief’s “designated stealer” role. I ended up deciding on a sword+axe armor with huge strength -
Because this is a second party to the first example’s; so that’s somewhat covered: the bow unit ended up with both skill and speed, and complemented by a sword flier with even higher speed - which was rounded out by a second low-speed unit (trainee, promoting to bow+lance armor or archer) and a high-HP but rather all-around Mercenary.
So when those twelve meet up, you end up with units that overlap (as both armies have ‘tanks’) and units that don’t (‘speed’ vs ‘strength’ bow units). There’s more units I could talk about, but that’s the core of it -
Making sure that units have different sub-genre purposes if they are the same class, but are able to sort-of pinch hit for the main purpose that you want a unit of that class (to avoid confusion) “feels” best to me in the vague designer sense I possess, that this gives the most agency to the player’s decisions - You have the ability to deploy the units you like or whose playstyles you like or some combination thereof, and the player can choose to use a heavily lopsided army, one with ‘an answer’ for each weakness a different unit possesses, or an army of all-around units - I think the last one is bad/bland/uninteresting, but that’s not really for here.
The reason I say this is because critically a given character in this context is many things, but a vehicle for a player to make choices is the ‘largest’ one. They can play the game one way or another, and the accessibility of being able to do as they desire is dependent on having units of multiple kinds, but kinds are not actually classes.
And the reverse is true, too, you can make multiple classes that are the same kind of unit. I kept making a ‘generic offense’ profile -
In this version, archer, mage, mercenary, cavalry - but despite the hugely different classes, it was still a problem: they played too similar, the bases preventing their growths from mattering until promotion.