Leaving dialogue aside, I doubt there is a single ungrammatical sentence in the basic text of Tolkien’s two great works, The Hobbit and The Lord of the Rings. However, I will say something more about his writing skill that puts him in a totally different league.
I admit that I am not super well read. I certainly have missed a lot of recognized classics. But I have indeed read a lot over my 70+ years. Of all the authors I have read in the English language, two stand out as written in such clear and beautiful language that they are a joy to read aloud to another person, such as a child who is new to the enjoyment of reading. Those two are J. R. R. Tolkien and H. G. Wells.