I think Murphy's Law summarizes the two situations perfectly.
According to the Cambridge Dictionary:
the principle that if it is possible for something to go wrong, it will go wrong
The bus is always late but today when I was late it came on time - that's Murphy's law!
An extension of the original Murphy's Law is called Finagle's Law, which states:
Anything that can go wrong, will—at the worst possible moment