It's Happy If It's What The Character Ultimately Needs
Give the character what they need the most.
Let's compare two endings.
Character A is a brave adventurer who wants nothing more than to explore the world and take on monsters for the rest of his life. The author, though, decided to rope him into a relationship. Now the adventurer has a husband and he's forced to take care of three kids, abandoning his life of adventure forever. Is that a happy ending?
Character B is a shy librarian who wants nothing more than to get a husband and three kids. Instead, she is forced to be a famous adventurer, wandering the world and fighting monsters for the rest of her days. Is that a happy ending?
Well, it's a matter of perspective. Did the characters get what they wanted at the end of the day? Heck no, both of them are living the life the other one wishes they would have.
Here's the more important question, though. Did the character get what they needed? Is this a satisfying conclusion to their character arc, one that shows their growth and truly gave the best possible outcome for both characters? It could be.
Character A thought he wanted to be an adventurer, but now that he's seen how dangerous it is, and now that he's had a taste of the simple life, he realizes he doesn't want to go back. He loves his kids, loves his husband, and he's never been happier. His arc is that he went from a fighter to a father.
Character B thought she wanted a simple life, but, guess what? Now that she's had a taste of adventure, she's absolutely hooked. Who needs a domestic life when you can fight dragons and tame manticores? Her arc is going from a shy nerd to a fearless adventurer.
A happy ending is not fulfilling what the character wants or what they desire. It's about what they need to make themselves the best they can be by the end.