Without details of what specific data a language model was trained on, there is no way to differentiate it having retrieved that name from a review of the book that was used with permission from the author (which is their own copyright and fair use on its own) or from the books itself (which would be copyright infringement).
If those records don't exist, the only mechanism you have left is to try and get the language model to spit out sufficient verbatim text from the source material to cross the fair use threshold. This doesn't work in the case of "obvious extrapolation" either which is a whole other defense that could be used depending on what that body produced was (If knowing only that the main character is named Harry, who is a wizard going to a wizarding school in the British countryside is required to produce a couple of close looking paragraphs, you need a much closer match with the original text over those two paragraphs for it to be infringing).