The thing is, yeah, I’m canon I guess it’s suggested that she would come back, but the thing about the end of any piece of media—and especially games, because of their ability to create semi-real fictional spaces—is that, when you reach the ending, it stops being a living world. You know there won’t be any more development in the game, and so the state of the world remains “Lillie has left Alola” forever. The world of the game doesn’t continue; it ends with Lillie leaving, and you know she is never coming back—whatever the game might say, it doesn’t bring her back, so in an important sense she has left you forever right at the end of your journey.
It’s a really powerful—and probably the best—move from a design perspective, because if she stayed she would become an NPC with one line, like Hau and Gladion, and she would cease to be a living character. Lillie is such an interesting and lovable character, and by having her leave at the end they avoid the sort of quasi-death other characters undergo, leaving behind the corpse of a one-line NPC that will never continue to grow as the characters have done throughout the story. I think this—Lillie remaining in our memory only as a living character, the end of the story making her departure permanent—drives that powerful feeling of melancholy that everyone is hit with on finishing the game; our good friend and almost-lover is still out there, but we’ll never see her again. Add in the difficult-to-process circumstance of her leaving suddenly and without warning you, and it becomes clear how this ending has generated so many fan works trying to explain, deny, or understand her departure.