I can never really endorse a book (or movie) that ends badly - and there are a lot of them. I mean works that begin well and fall to pieces to end poorly. It seems to be much more difficult to end well than to begin well.
It is interesting to speculate why this might be. There might be many reasons - but one is clearly that the author is technically able to write, but does not have anything to say. The book goes nowhere, because there is nowhere for the book to go.
This is a product of the fact that the work cannot be greater than the man - and there are a lot more technically-adept Men than there are great Men.
For the same reason, there are a lot more first-rate minor writers, than major writers; and many problems arise from a minor writer trying to give the impression he is major. The word for this is pretentious.
Another, related phenomenon is more modern - which is an author striving for originality or to 'make a point' - usually of a socio-political nature. Such authors sabotage their own works by their desire to avoid at all costs being clichéd; avoiding what they regard as tropes or stereotypes; wishing to be known as to be 'subversive', edgy, dark...
That is; the desire primarily to please critics, editors, scholars and 'pseuds' in general. Naturally, this leads to poor works.
Such self-sabotage with the intent of garnering the praise of those whose world view is primarily ideological can, itself, be a mask for incompetence; but is not necessarily so.
One of the most notorious self-sabotages in literature is the ending of Pygmalion by George Bernard Shaw; which has Eliza Doolittle marrying Freddie instead of Higgins - as the narrative irresistibly suggests she would.
Shaw was trying to make an anti-romantic ideological point - as he explained in a (very unconvincing!) post-script; and for this he was prepared to wreck the end of a brilliant play - and he then doubled-down on this error.
Because the actors who were successfully touring Pygmalion away from London changed the ending (without telling Shaw) by adding some unspoken 'business' to imply that Eliza would actually marry Higgins. This 'played' much better with the audiences; who were otherwise leaving the theatre confused and dissatisfied.
Shaw was incensed when he found-out, and did his best to stop it; yet when Pygmalion was converted to one of the most successful musicals ever - My Fair Lady - the anti-Shaw pro-Higgins ending was retained.
Shaw was setting his undoubted genius against the autonomous and irresistible demands of natural narrative - and not even Shaw could make anything else work.
In writing Pygmalion; Shaw had something to say, and said it - which is why the work has lasted. But for the play to be truthful, there can only be one ending - and it is not the ending that Shaw wanted to write.
There are many works that contain much that is good, but are marred by a bad ending; and whether one responds to such works is a matter of preference.
A couple of examples from my experience are Phillip Pullman's 'Dark Materials' trilogy; which begins very well indeed but begins to fall to pieces even before the end of the first volume - and of course ends very poorly.
(The reasons why have been definitively described by John C Wright in his essay collection Transhuman and Subhuman).
Another example is Elidor by Alan Garner - which is generally well-liked but which has an ending that is both abrupt and unsatisfying.
Why this should be, I believe to be related to an element of bitter, disillusioned (apparently guilt-motivated) class-resentment; that seems to have grown in Garner throughout adult life almost to overwhelm him - and to spoil most of his books (and especially the endings).
Both Pullman and Garner are technically very gifted writers who are limited by their own natures, which are significantly stunted by their (very typically modern) failure to learn from experience and consequent doubling-down on a false and nihilistic world view.
That same critic-pandering, reality-rejecting pathway was pioneered by James Joyce with Finnegans Wake, and Samuel Beckett from 'Godot' onwards.
From the above analysis it can be seen why so many movies of the past few decades fail to end well - after a promising start.
There is this determination to be praised for 'courageous' (ha!) subversive/ edgy/ dark qualities - for imposing value, sex and plot inversions without regard for the natural demands of narrative. So the movie draws us in, sets-up a situation - then delivers... nothing. No closure. No meaning.
(And then gets Establishment-praised for 'bravery'!)
To construct a coherent and satisfying movie remains possible (e.g. Groundhog Day, Dunkirk), but is never easy nor common - and these all have a strong sense of inevitability about their unfolding and resolution. How much simpler to write politically-correct dross - and reap the awards...
Surprising plot twists and ends can be done effectively - e.g. Maleficent, Rogue One; but always by deploying some alternative 'traditional' story trope - such as self-sacrificing heroism.
In other words, new story shapes are possible; unpredictability and surprising twists may be effective. But these require exactly the kind of endorsement of narrative inevitability that the subversive/ edgy/ dark anti-heroic impulse rules-out.
In sum; some of the poor endings (and, indeed, middles) of novels and movies can be explained in terms of authorial limitations; but even-more is subtracted by authors trying to make socio-political points, or curry the favour of cultural gatekeepers at the cost of narrative destruction.