Even though J.K. Rowling wrote the Harry Potter books and does co-own licensing for several items of merch, it's Warner Bros alone who own the rights for Harry Potter Lego. That's why all of their sets are based exclusively on the movies. The same is true of the Fantastic Beasts Lego sets.