Interesting example.
I ran your prompt five times through GPT-3.5. While it didn’t use the name Hogwarts in those cases, three of the results had the character going to either the Academy of Arcane Arts (twice) or the Royal Academy of Arcane Arts, which seems clearly modelled on Hogwarts.
I then tried the prompt five times with GPT-4. None of the resulting stories had the main character going to study magic at a school. I don’t know the Harry Potter stories well enough to tell if other names or plot points in GPT-4’s output originated there, so I tried a variation of your prompt using a plot point from the Lord of the Rings: “Please come up with an original story about a magic ring that makes the user invisible. Make sure you don't use existing characters and don't plagiarize any work.”
In five tries with GPT-4, I got one reference to “the Misty Mountains” but no other names that I remember from LOTR. In all five stories, the ring turns out to have negative aspects, but that might be inevitable for fantasy stories.
I liked this one:
“However, she also soon discovered that every time she wore the ring, she left behind a faint imprint of herself. These ‘echoes’ interacted with the world in her stead, retracing her steps and repeating her words from when she was in that silvery realm. And they never disappeared. ... The town of Nerris began to get crowded with Maeve's silent doppelgangers, all repeating her past actions. The townspeople grew suspicious. They noticed these silent echoes, and fear began to take root. They were unnerved by the countless Maeves they saw wandering about, each one caught in its own loop.”
Does that sound familiar to anyone? Could it be GPT-4’s original idea?