However, the producers could be sued by JK Rowling if they use her characters
Does Rowling own the characters?
Even if Rowling has sold the intellectual rights to Harry Potter to the studio (which I suspect she has) she still could have grounds to sue on basis of damage to her original concept.
Monty Python successfully sued a TV network that wanted to intersperse commercials when airing episode of MP's Flying Circus. The network owned the complete series outright but John Cleese (who was educated as a barrister) argued -- successfully -- that each episode was a work of art to itself, and the contiguity of an individual episode was intrinsic to its artistic value.
Rowling might well argue that the atmosphere of the Hogwarts ecosystem is based on a number of precise premises she established in its creation, including the strictly binary nature of all its characters.