The original Comedy of Errors was one of the early plays from the pen of William Shakespeare, believed to have been written between 1589 and 1594. One of Shakespeare’s shortest and lightest comedies, its title is quite literal in that much of its humor plays on the fact that the cast of characters include a sets of twins, each unaware of the other’s existence and constantly mistaken for the other, and their servants, who share the same name, leading to much confusion.
The phrase comedy of errors can today refer to any effort or event that is subject to a series of mishaps, whether dramatic or in real life.
The timing, however, could hardly be better, as the show's seventh season finds Louis-Dreyfus' Selina Meyer embarking on a new presidential run, unleashing a comedy of errors as she begins by crisscrossing Iowa, attending events and meeting people for whom she privately harbors nothing but disdain
— Brian Lowry, CNN.com, 29 Mar. 2019
As comedy on its own gets attached to other subgenres, such as comedy of manners (one that mocks the pretensions of high society), the word comedy itself can be attached to other things:
"To deceive the police naturally," said Razumov savagely.... "What is all this mockery? Of course you can send me straight from this room to Siberia. That would be intelligible. To what is intelligible I can submit. But I protest against this comedy of persecution. The whole affair is becoming too comical altogether for my taste. A comedy of errors, phantoms, and suspicions. It's positively indecent...."
— Joseph Conrad, Under Western Eyes, 1911