I would suggest that cosmic irony has a lot in common with situational irony, to the point where it might even be understood as a subset of situational irony. Situational irony, it should be remembered, involves a sequence of events that plays out in such a way that its outcome runs contrary to initial expectations. You can observe situational irony in many twist endings. Take, for example, "The Gift of the Magi," in which Della sells her hair to buy a watch-chain for her husband, even as he sells his watch to buy combs for his wife. This famous short story would provide an example of situational irony in action.
Cosmic irony is essentially a form of situational irony in which superhuman or supernatural forces are responsible for creating this irony, often at human expense. Consider, for example, the story of Oedipus and its treatment of fate. In the Greek myth, Oedipus is told that he is fated to kill his father and marry his mother. Seeking to avoid fulfilling that prophesy, he leaves his adoptive parents in Corinth (unaware of his adoptive status), and in the process fulfills the prophesy. He kills his father in a dispute and later, after rescuing Thebes from the sphinx, is rewarded with kingship and marries the city's queen (his birth mother). In this story, Oedipus is treated as a pawn of fate, and while he might seek to avoid the destiny assigned to him, he is ultimately powerless to overcome it. This would be an example of cosmic irony in action.