i'm going to add a little bit more to this.
something i didn't mention last post is that pokemon trainer himself is actually not coded completely out of the game. this can be proved by going into subspace, playing up to the ruined zoo, and defeating porky. if you select pokemon trainer, pokemon trainer will be there once squirtle spawns in. as well, if you play up to the ruined hall, you will spawn in with charizard. continuously using rock smash on galleom will provoke pokemon trainer to switch pokemon, since it is his down-b, however charizard ignores the poke ball. i assume this is because the game expects charizard to begin the animation of going into the poke ball, and when it doesn't, the game chooses to do nothing and let rock smash occur like normal. i have encountered some oddities with pokemon trainer in the ruined hall, specifically that pokemon trainer will actually send out charizard for whatever reason, though it doesn't change to squirtle. simply the animation of charizard coming out occurs. basically, pokemon trainer and the three separate pokemon are disconnected from each other, and intentionally so.
also, pokemon trainer's icon also isnt coded out of the game. this can be proven by going into all stars and defeating the first character. once spawning into the rest area, you can clearly see pokemon trainer's icon next to the rest of the characters in the pokemon franchise. however, from a previous post, pokemon trainer will crash the game once the game tries to spawn him into the game.
so if pokemon trainer's icon isnt coded out of the game, why does the game crash when you select lucas? wouldn't it spawn in like normal? well, pokemon trainer is actually programmed to not exist. if you go back to a previous stage to the character select screen after completing the ruined zoo, you will notice that lucas is only by himself. as far as the game sees it, lucas doesn't have a partner because pokemon trainer isn't a valid character to select. you can see pokemon trainer on the save screen though, for in case you go back to vbrawl i suppose. so let's go back to the ruined zoo. if you select lucas, the game tries to place pokemon trainer in the lives column. however, it specifically checks for a valid character to put into the lives column. since the game doesn't think pokemon trainer is a valid character, the game crashes before loading the level. the game doesn't seem to have this same check when spawning pokemon trainer after selecting him into subspace.
one final thing i want to note is once you reach the ruins, since there is no cutscene preceding that specific level, the game brings up a character select screen. same as before, the game recognizes that lucas is the only valid character to spawn in, and spawns him into the level and closes the character select screen automatically. if you die, pokemon trainer won't actually spawn in, it'll spawn in lucas once more.