In Italian, a fiasco is a bottle. The word also names a round Italian bottle wrapped in a close-fitting straw basket, the classic Chianti bottle. Nobody knows for sure how it came to mean a disaster.
The word goes back to Late Latin flasco, "bottle." That is also the source of English flask and, through Old French, flagon. So fiasco and flask are cousins, one meaning a container and the other a catastrophe.
The failure sense grew up in Italian theatre and opera. A performer or a show that flopped was said to far fiasco, "make a bottle." World Wide Words places the expression among Italian stage people in the eighteenth century. French picked it up as faire fiasco, and English followed.
The earliest English example in the OED, as quoted by Grammarphobia, is from an 1855 letter: "Derby has made what the theatrical people call a fiasco." Etymonline says that by 1862 it meant any ignominious failure, not only a bad night at the theatre.
The explanations for the bottle are many, and none has evidence behind it.
The most repeated one involves Venetian glassblowers. When a fine piece went wrong, the story goes, they turned the flawed glass into a plain flask instead. Merriam-Webster reports this tale but says it remains unsubstantiated.
An often-repeated story, told by World Wide Words, credits a harlequin named Biancolelli. He is said to have improvised a routine with a bottle, got no laughs, and thrown it down in disgust. Actors then used the word for any failure.
A third idea comes from a game. Etymonline cites an 1870 Italian dictionary in which fare il fiasco meant losing a game and buying the next bottle of wine. That at least ties the bottle to a loss and a cost.
Etymonline also lists the idea that it refers to a bottle bursting. World Wide Words concludes that the puzzle is probably insoluble without better records. Grammarphobia quotes the OED calling the shift "of obscure origin."
So the honest answer is short. The word certainly means bottle, and it certainly came from the stage. The link between the two remains a mystery.