Actually, first written by W. S. Gilbert in the 1885 operetta, "The Mikado" (libretto, see act II, 1st dialogue line after the song "See how the Fates their gifts allot"). The original line is "Well, a nice mess you've got us into, ..." spoken by the character Ko-Ko to Pooh-Bah, in reaction to a lie the two of them, and another character, have told to get out of trouble, but which has resulted in them getting into even more. The ubiquitous popularity of some of Gilbert & Sullivan's works (specifhttps://en.wikiquote.org/wiki/Misquotations