So highest-grossing doesn't mean absolutely anything about how good a movie is, or whether people actually liked it. There is a huge contingent of people that follow religiously a franchise and will pay to watch the new one even if they've been told it is not very good. You don't skip the latest Star Wars movie if you call yourself a Star Wars fan, and it is marketing's job to create the Star Wars fan in the first place.
As a cynic, I'd argue the opposite to what you said: you have to spend more on marketing if the material is not very good in the first place. The result is a terrible movie that becomes a meme and still makes bank.
Attendance is expectations, and rating is reality, after the necessary act of paying to watch the film. A film that someone is excited to see can still stink.
It did make 30% less than TFA.
Otherwise, yes, I generally agree that sales are not necessarily an indication of quality.
Marketing can boost ticket sales, but there are plenty of examples of movies which flopped despite heavy marketing, just because the audiences didn't like the movie that much.
The ratings on RT and IMDB does not represent the average audience member.
The third movie was still one of the most successful movies of all time.
I was astounded by just how bad it was -> rating.
I did see the next one (the last of the Skywalker series), mostly out of morbid curiosity. That one was just...random. After that I stopped. The halo of the franchise only carries so far.
The thing is, the last trilogy was tremendously enjoyable by general audience, and this is what generates sales after initial weekend. Few butthurt starwars nerds writing endlessly on internet (just like here with consistently flawed arguments) or review bombing out of pure hate don't change anything, luckily.
I had great fun, considered it as brainless popcorn fun just as original trilogy and prequels, exactly just like everybody else I know. Sometimes, that's enough.
In reality, sequels tend to be less successful than the original, but can expect a certain audience. Since only very successful movies get sequels, sequels are still safer investments than original movies.