Sweet Charity's ending isn't supposed to be particularly happy. It is meant for us to see that she has had this kind of relationship before, and she will have another one like it and then one after that. Actually her affair with Oscar probably went better than the others, but this is a girl with relationship pattern issues.
(Of course a relationship issue is something that none of us have any first hand experience with. Not.)
You've got to see the source material, Fellini's The Nights of Cabiria to grasp what Fosse was getting at.
Gwen was the unbilled assistant choreographer on the film. She taught Shirley most of the dances. Gwen knew that she's never be given the role since she wasn't a movie star and was looking into the jaws of 50 by that point. MacLaine was about 35-40 and was about the only real movie star at the time to dance that well. After the film of Damn Yankees Gwen wasn't all that fond of the film process anyway.
Flaws and all I have always liked this movie. As a first film its pretty good.
"If my life weren't funny, it would just be true. And that would be unacceptable."
--Carrie Fisher