Is it? Let's look at a top-100 list of novels compiled by algorithm from over 100 other top 100 lists:
https://thegreatestbooks.org/
Here is the consensus top 5:
(1) In Search of Lost Time
(2) Don Quixote
(3) Ulysses
(4) The Great Gatsby
(5) Moby Dick
Their average length is 426,165 words. By comparison, the Harry Potter novels range between about 77,000 words and 257,000.
Great writers focus on what they want to convey, not on how many words it takes to do so. Understandably, that will drive away readers with shorter attention spans. A lot more people will get through "Harry Potter and the Alchemist's Stone" than "In Search of Lost Time." Many writers are willing to sacrifice some of what they're trying to say in order to hold onto the short-attention-span crowd. Others are not.