In Shrek 2, Dama Fortuna (the Fairy Godmother) gets out fairy tales with happy endings without ogres. But one of them is The Little Mermaid. Is she aware that it has a sad ending of the Prince marrying another Princess and NOT the Mermaid? What gives?
The Fairy Godmother is Prince Charming's mother. She firmly believes her prince should marry Princess Fiona.
As you say, in the original Hans Christian Andersen version of "The Little Mermaid", the mermaid fails to marry the prince. If she’d gained the love of the prince, she’d also have gained a soul and avoided becoming foam on the waves. Instead, she’s released from her broken heart as she dies, such is her happy ending. The prince, however, marries a princess.
In the Disney version, Ariel is clearly a princess, being one of the daughters of Triton. In the end, she marries a prince.
If anything, I think this particular example of a happy ending is left deliberately ambiguous, maybe for humour. Those who are thinking Disney look no further than mermaid princess marrying prince for their happy ending. Those who think Anderson can see that the Fairy Godmother is ruthless enough to dispose of Shrek (the non-human fairytale character) so that her prince can marry the princess, as is proper in fairytales(!).
The Shrek franchise is a big parody of general fairy tales but especially Disney movies. For example, when Donkey flies due to pixie dust, everybody in the crowd says "he can fly!", as the song in Peter Pan.
In the "real" story of The Little Mermaid, Ariel vanishes into the sea, but in Disney's version, Ariel and Eric defeat Ursula and live happily ever after. They even end up getting married: