Suppose there are many people standing in a line to receive an expensive item as a free gift, and everyone receives it except for the last person in the line. The last one is told, "Sorry, the gifts are finished!". This person complains of his bad luck and says (sarcastically):
Oh, no! Now that it's my turn, all the gifts are finished. I don't believe it!
In situations like these, we Iranians have a saying:
Now that it's my turn, the sky fell down.
That is, the worst possible thing happened, and I lost the opportunity. It implies that once I reached the stage of almost realising the opportunity, the situation/condition changed completely, all of a sudden and unbelievably, and this is only because of my bad luck!
Is there any idiom, expression or proverb that conveys a similar meaning to that Persian saying?
I am looking for something that is more general, something that can be used in any situation in which an (important) opportunity has been lost just because of bad luck. This Persian saying places the blame on the bad luck of the given person—someone so unlucky that even the most impossible outcome (the sky falling!) happens just at the moment that they expect to achieve something and causes them to lose a good opportunity.
In my example, that person was very unlucky: if his turn was only one person ahead, or if there was just one extra gift, he would have received a gift. So, he says: "The worst thing happened only to me out of all those people! D**n this luck!"