It's not a specific Harry Potter problem. When any author right a books (or any artist create any kind of art work really) and another author or person what to write a book (or create any kind of artwork) that is based or support or criticize on the first one - they have to get permission not only from the author but from the publisher as well.
Even if you wrote a book that quote a song or a poem by another writer - you need to ask permission and often pay money to whoever owns the right for the original creation. I went to a Neil Gaiman signing event abut a year ago and he told about how he had to change the words of a song one of his characters was singing in a karaoke because the person who owns the right wanted 20,000$ for it.
Usually, authors and writers have no problem with being quoted as long as they are being asked before hand, it promote the book they wrote and everyone is happy. I think that the thing about this is that, first of all, the lexicon wouldn't sell shit if it was about someone else, it's going to be a best seller now because of the hard work J K Rowling put in writing"harry Potter" and the massive amount of money the publisher put into promotion. Basically the author of the lexicon is going to make a lot of money without sharing it with the person who is responsible the success of his book.
Also, there is a matter of accuracy and making sure the book is not a pile of garbage - the information was collected from the internet (by the way - were they offering to pay the people who did collect the info in the first place?)which means it might be partly wrong.
The question of fan fiction in all kind of different forms came up in almost every author reading I went to this year. Authors seemed to be pretty confused about it - on one hand, it's flattering someone likes your books so much that they are inspired to write, on the other hand - people are trying to become famous and make money from what you created without your concent.
Phillip Pullman said it best when a couple of weeks ago "I don't mind it, just don't ask me to read it and if you ever get published, you are going to hear from my lawyer..."