By the way, I know this conversation has gone all over the place, but as for the original question if someone DID want to submit to COG:
I am a math professor, and occasionally have students write papers.
Some just copied Wikipedia. That’s plagiarism.
Some copied a webpage and rewrote each sentence, keeping the order and ideas of the sentences. That’s plagiarism.
Some students copied many webpages, mixing up the ideas from the different webpages and rewriting sentences in their own words, but in different orders.
That’s research. They got an A.
If someone (not OP, since they’re doing fanfiction) wanted to do a wizard school book, I would look at many such books (including The Worst Witch, Harry Potter, Discworld, even Star Wars and Jedi training) and create a grand synthesis, changing everything into your own words.
The more sources you include, the better. As you include sources, you find common patterns of things that you like that are from many other series. These are tropes, and tropes aren’t plagiarism.
Anyway, those are my thoughts. My own WIP contains a chapter with a genderswapped version of Poltergeist where you are accidentally the ghost. But no dialogue or characters are the same, and it’s mixed in with many other things, including a cult and a higher-dimensional baby.