It happens.
Just last week I was on ORD-DEN. We had an on-time departure, arrived 20 minutes early, and had to wait for our gate. The pilot comes on the PA and says "The aircraft occupying our gate should be pushing back at any moment." To be fair to the pilot, he was getting this information from operations.
Fast forward 45 minutes later. We're still in the penalty box while people in operations scramble for another gate because the aircraft we were waiting on went mechanical. The parking brake on my flight was finally set 55 minutes after entering the penalty box.