I thought that was mostly about coincidentally similar names.
Does it change when one is explicitly a reference to the copyrighted work? It's not like Thiel just thinks that Valar and Palantir and Anduril etc are all just nice sounding words, he's built a brand out of companies named after Tolkien's stuff.
IANAL but I would assume that such an agreement (A) falls under trademark law and (B) is being done to avoid a costly/embarrassing fight, even if it's a fight Thiel might win.