Not sure that’s correct.
Copyright attaches to the actual text (illustrations, etc; whatever is “fixed in a tangible form”), not the ideas.
You could write a story about a boy of humble origins who is whisked off to a special school, discovers he’s special, and fights evil. There aren’t that many original plots, after all....
You’ll only get into trouble if the main character is called Harry Potter of 10 Privett Drive, where he resides with his mother’s sister and her awful family, and he later attends Hogwarts, etc.