The whole purpose of the first phase is to ensure that nothing fails during the commit phase. At least due to data integrity or business process point of view. So if the prepare phase of the commit is fine then it can be assumed that commit will work, except network/communication failure.
All the participating system must agree on one or the other way of handling the situation
1.Auto-commit. If the rollback is not explicitly called by the coordinator,(within a given time) the transaction would be treated as committed by the respective participating system.
2.Transaction Coordinator retries for each failed component. In case of network failure the retry may still work.
3.Compensation. After a specified number of retries the transaction coordinator assumes that the transaction has ended in an inconsistent state. It can then try to compensate. ( note: this is not necessarily the roll back, this is like actions to be taken when a transaction fails).
Now think about this. Compensation itself may not be successful across all resource managers.
Some business processes may need manual compensation as well ! SO you need to log, raise alerts and a manual compensation may be needed to bring the system back to the original state.