If you take a look in the 5E Dungeon Master Guide, you will see Chapter 4: Creating Non-Player Characters. It mentions these specific aspects of a memorable NPC character:
Occupation and history
Appearance
Abilities
Talent
Mannerism
Interactions with others
Useful knowledge
Ideals
Bonds/allegiance
Flaws or secrets
They even give tables so you could create a detailed NPC in just a few die rolls. Gosh, if you have writer's block, this is the place to go! Occupation is certainly on the list, but it is just one of many things, and there is very little discussion of occupation in Chapter 4 except for the villainous variants given at the end. Chapter 4 shows you how an AI algorithm might be able to create the NPC's, possibly with input from the player. In fact, Argyle might already be an AI thing ... how would you know?
You are confusing NPCs in the tabletop sense with party NPC companions (which are in fact not truly NPCs since you play them). Tabletop NPCs don't even have classes.
But yeah classes are definitely part of a character's character. Different character's are mokdable to different degrees in this regard. For example you brought up Nalia -- her class is definitely a reflection of her defined character history and she wouldn't fit as anything else. Same with Dragonspear Keep Girl -- being a Paladin is literally part of her motivation and if she wasn't a Paladin the story would change -- and Irenicus who could only be another arcane caster class.
If we look at the actual characters in question:
Astarion: Could be changed to a lot of things, but Rogue certainly fits his character best.
Gale: Being a wizard is literally 99% of his personality
Laessie: Needs to be a martial class for her story to make sense
Shadowheart: Could fit as an Arcane Trickster, but being a Cleric of Shar is pretty firmly tied to her concept
Wyll: His story is about being a Warlock, or at least his infernal pact. Sure, technically selling one's soul to devil doesn't necessarily have to mean you have to have the Warlock class but it's pretty much that, Fighter, Ranger, or Paladin, as far as his characterisation goes.