>>30454163It was better for her to leave at the end of the game, if she stayed with you she wouldn't really have anything to do
Her ultimate goal when she meets you is to figure out why Nebby exists, then her secondary goal later on is to save her mother
When you finally evolve Nebby, her main goal is accomplished, with the only one left being to save her mom
Remember, the reason why she leaves you is because she wants/needs to save her mother, and she wants to learn how to defend herself without relying on you, and she did say that she would come back later on
Plus, she technically wouldn't want you to be sad while she's leaving/is gone
I was bummed out too when she left until I realized these points, the only thing you really have to worry about is if she will reunite with specifically the Sun/Moon protagonist, which is entirely up to GameFreak