S J Lee
Inkling
It's doable and legal, but you can't sell it. You can do a Harry Potter fanfic on Pottermore, but even if it is 100% brilliant, no publisher would ever touch it UNLESS you changed all the names and the "universe" . . . OR JK Rowling gave you permission, which she will not . . . unless she is creating a "franchise". . . eg, Fantastic Beasts etc, but writing fanfic is hardly the best way to go about it. Agent talking to agent would be better...?