Barbara Diamond, the wife of I.A.L Diamond (Billy Wilder’s writing partner for ‘Some Like It Hot’ and other Hollywood classics) said this about THAT famous last line in the iconic 1950’s comedy:

“One of the results of the way they worked is that it was impossible for them to seperate one person’s work from the other. They honestly didn’t know who had written particular scenes or individual lines, and truthfully, they didn’t much care.
The one line that they did know about turned out to be the one that everyone asks about, “Nobody’s perfect.” When asked, Billy always said that it was a throwaway line of Mr Diamond’s and they had hoped overnight they would think of something better, and Iz never contradicted him. However, I have a different version of it. I wrote the scene the day before it was shot and left a copy here with me while he took it over to Billy. When he came back and asked me what I thought, I told him it was a great scene but the last line was weak. He said, “That’s what Billy thinks and you’re both wrong,’ and proceeded to tell me why.

First of all, audiences love being able to anticipate a joke. The dimmest members of the audience know that Jack’s last line is going to be “I’m a man,” and they are bracing themselves for the explosive reaction. Therefore the only way to surprise them is to have no explosion, and the flatter the line the better.
The laugh comes from the structure of the scene, not the particular line. Would ‘never mind’ have gotten as big a laugh as ‘nobody’s perfect?’ quite possibly.

One reason why Billy called it a throwaway line was because it had briefly been in the scene where Tony is explaining to Jack why he can’t marry Osgood and was taken out because it stepped on another joke. I don’t imagine it gets as big a laugh now as it used to, the element of surprise is gone.
Iz loved that scene. When we were all on a European publicity tour for the picture he used to sneak into the theatre to watch the last few minutes, just so that he could hear that roar of sheer delight as Daphne and Osgood sail into the sunset.
I don’t think he ever really thought of it as a throwaway.”

I.A.L (Iz) Diamond and Billy Wilder