As much as another hated bringing irony into this, that is essentially what anything described as a "cosmic joke" is - irony (granted maybe weak irony). maybe it is just unfairness, but like irony, "cosmic joke" generally wants something more than merely unfairness or incongruity.

The irony/unfairness in the passage you describe being simply that of two workers where one commands a salary of twice as much as the other, there is no difference in their abilities..