Theory/Idea/Story/Thing: The Ghastly belonged to her nearby Neighbor, an older woman, with a deep affection for ghost pokemon, but this particular ghastly always wandered off at Night, but the woman was not concerned, as pokemon caught and belonging to another trainer cannot be captured, and it was always back by morning..
Eventually the elderly woman learned where her pokemon, now a Haunter had been going for the last several years, a few short houses down, so she offered a deal to the young woman living there, she was willing to trade her haunter for Any pokemon, as long as every month, once a month, they stopped over for lunch.
the old woman was always angry when they were late, but they always seemed to call ahead in case they might be.
needless to say, now that the woman retired from her job at the Kanto elite four, they see each other more often, and have become good friends.