My opinion on the matter stems from Wasteland 3 and games like it.
Wasteland 3, if you haven't played it, allows you to create new characters fairly early on, when you want, and then spend an "initial set of points" to "create their jobs". You "create the jobs" by just dumping points into "skills" and "stats".
Where the system runs into issues is that there is nowhere near enough "skills" to properly "diversify" any party. There are like... 5 weapon types in the whole game. You can have, I think, 8 characters. So, you've got some overlap here with weapons and abilities.
Then, you've got a lot of overlap with the "stats", since there are few stats and tons of skills... so multiple skills will use the same stats. This limits how you build your characters, or causes you to "overlap" their stats. It is almost universally better to put all the "skills" that rely on the same "stats" onto a single character in order to maximize all future point distribution.
So, of all the "potential" combinations you've got... you're limited to a very small amount of "viable" options or "useful" ones. For example, it's more useful to have your melee fighters also specialize in "explosives", because now they've got a ranged attack, and the important "disarm explosives" skill isn't really used until the end of battle anyway... so no sense eating up points on useful ranged characters to do that job, when it's already more useful on the melee fighters.
This is, ultimately, the problem with "many classes". You need to worry about "overlap". Do 3 Tanks all serve the same purpose in battle? If so, you can get rid of 2 of them.
In terms of your design, I'd simply take 1 of every class and 1 of every race, and call it a day. I might try to "optimize" the race with the class, but that's about it. Then, I would just see what every class does, and pick what I'd like to play with, or what is "most optimal".
Ultimately, a set up with 8 people in combat is going to just be better all around than one with 2. Even if those 2 get "bonuses". I'd be able to "farm" much faster with a group of 8 beating down 4 enemies than I would with 2. Even if those 2 get "bonus XP". You'd have to do a calculation of "XP per minute" to balance that properly. After all, if I can get into and out of combat 5x faster with 8 people than with 2... I'm potentially earning 5x more XP. Pokemon suffers from this issue 😀 "Oh, everyone gets REDUCED XP if you have a full party" and I go, "Yeah, but it's overall MORE XP since it's above 100% XP gain... so... it's more efficient and far better to have 6 than 2". Especially in terms of trying to level up many at once and evolve them all at once.
Is it better to have a party of 8 at level 10 beating on a Level 15 boss... or a party of 2 at Level 15 beating on a Level 15 boss? I can tell you instantly who is going to have the "easier" and "faster" time of beating that boss.
Honestly, I would make the party size "static" for ease of balancing on your end. I wouldn't make "party size" be "optional". I probably also wouldn't make jobs be "optional" either, unless there was a good reason to do so. If you have 8 classes and 8 characters in combat... just make those "static" as well. One character of each class. Done. Unless you can think of a good reason to let the player pick 8 White Mages or 8 Warriors, then there's really not a good reason to "let them pick the class", either.
And this is coming from a person who is designing a game in which nearly everything revolves around player choice. From where they go, what they do, how they complete the quest, and how they level up their skills...
Yep, I'm telling you that unless there's a good reason to have that "choice" for the classes exist... you may as well just REMOVE the choice entirely. Your game will be better balanced, and characters will be more memorable and easily connected with by players (which means your story will be more easily connected with as well, since there's a certain level of investment in the game creating the identity of the characters as opposed to letting the player attempt to assign value to what they've created).