Hi, Deadman and all.
Thinking about your original question, I would suppose that the ending of the story should make sense within the story itself. While the occasional surprise ending out of left field can please readers, it can also disturb them. You should also keep in mind that if you persuade a reader to invest in your heroic and likeable protagonist, only to have tragedy befall them beyond the protagonist’s control, the reader might get upset with you.
As a comparison with another medium, if you watch episodes of The French Chef, you know that the lobster always “gets it” in the first five minutes. But if you watch Leon the Lobster, you would understandably get upset to see the bright-red shell, the lemon slice, and the drawn butter. If the audience agrees with the ending you’ve chosen, then you’re writing well.
Or, I suppose you could deliberately write stories where the (tragic) ending only makes sense to the reader on a second or third reading. But if you do that, keep the fireproof curtains well-drawn while you build up a following.
Cheers!