Your story’s “Outcome” is determined by success or failure in the attempt to achieve the overall goal. But this is independent of whether or not everyone is feeling good about the outcome, even if success is achieved. Often the costs of achieving a goal outweigh the benefits. And in some stories, achieving a goal may turn out to be a hollow victory.
Similarly, failing to achieve the goal may not be an emotional distaster as well if the characters learn something of greater value or grow in ways that is far more meaningful than the failed attempt to achieve. Put these in combinations and you get the Success/Good story (a triumph), the Failure/Bad story (a tragedy), the Success/Bad story (a personal tragedy), and the Failure/Good story (a personal triumph).
Using the two dramatic elements of Outcome and Judgment and adjusting the degree of success or failure and of personal fulfillment or devestation , one can create any variety of conclusion for a story from the “happy ending” to the “sad ending” and every bitter-sweet combination in between.