I think you are confusing the play with the film. Agnes inadvertently drinks too much champagne. It certainly is not her intention to get drunk. She then gets confused by what has happened between her and Brian. She thinks that they saw a movie in which Gary Cooper marries his sweetheart when in reality she and Brian are the bride and groom. This is a contrivance which has been used before in various golden age screwball comedies, most famously in Sturges' The Miracle of Morgan's Creek. In the film Agnes never calls her unborn child a bastard.