In addressing your question of "What does a wedding have to do with running out of wine?"
A little biblical background about wine.....
A drink-offering of wine was presented with the daily sacrifice (
Exodus 29:40 Exodus 29:41 ), and also with the offering of the first-fruits (
Leviticus 23:13 ), and with various other sacrifices (
Numbers 15:5 Numbers 15:7 Numbers 15:10 ). Wine was used at the celebration of the Passover. And when the Lord's Supper was instituted, the wine and the unleavened bread then on the paschal table were by our Lord set apart as memorials of his body and blood.
Joel states.......
The LORD replied to them: "I am sending you grain,
new wine and olive oil, enough to satisfy you fully; never again will I make you an object of scorn to the nations. (Joel 2:19)
The new wine that Jesus created is the wine of his new covenant, which is related to his blood sacrifice and is solely tied in the consecration of his bride, the Church.
The symbolism of the wedding at Galilee is that the wedding organiser is the Father in Jewish tradition and the bridegroom is the Son and the bride is the Church.
Please note that he was asked to produce wine towards the end of the wedding, as the final consecration of the bride.
Jesus would say.....
"
My time has not yet come"
This phrase is directly associated with the wedding supper of the lamb of God, at the time of the consecration of the bride, towards the end of the harvest, where Jesus will produce the best tasting matured (sanctified) wine, so that it leaves the Father to comment.....
"
You have kept the best wine until now!"
When the final consecration of the body and wine comes, then the saying is made.....
7Let us be glad and rejoice, and give honour to him:
for the marriage of the Lamb is come, and his wife hath made herself ready. 8And to her was granted that she should be arrayed in fine linen, clean and white: for the fine linen is the righteousness of saints. (Revelation 19:7-8)
These are they who have come out of the great tribulation;
they have washed their robes and made them white in the blood of the Lamb. (Revelation 7:14)
Wine is the symbol of the blood of the lamb of God and when the bride is made herself ready, means it is time for the bride to....
"buy the oil, the bridegroom arrived. The virgins who were ready went in with him to the wedding banquet. And the door was shut. (Matthew 25:10)
The oil and wine in context to the wedding supper of the lamb of God is part and parcel of his coming to finally call up his bride onto him, in her final consecration.
Gather the people, sanctify the congregation, assemble the elders, gather the children, and those that suck the breasts:
let the bridegroom go forth of his chamber, and the bride out of her closet. (Joel 2:16)
Please reflect on what Jesus said in context to the wedding at Galilee and discern that he was speaking of his wedding day to come.
"
My time has not yet come"
Was it
his time when he would be crucified or
his time when he would return for his bride?
The two clues is the chronology of the wedding events in Galilee, they being, that the wine was running out, and towards the end of the wedding.
We can picture this event of wine running out, towards the end of the harvest, when taking into consideration the falling away, that was taught by Paul.
The wine of the harvest is the discipleship throughout the world, when it heads towards running out within the context of the falling away, then Jesus performs the miracle of producing a wine unlike any other, a wine that is so matured in faith, that the Father is well pleased of.
Is it not ironic that his first miracle was the turning of water into matured wine and how befitting and prophetic it would be for him to perform this in his body of believers, as the final miracle, before his coming as the bridegroom, before calling his bride up, to his place, that he prepared in his Father's house.