The movie was based on a play that William Goldman briefly discussed in his book "The Season". Goldman claimed the play would never have worked at all because of the concept, so I was very happy Wilder was able to prove him wrong and make it work as a movie, for the reasons you describe.