Question: If a man contracts to build a house, a school, or the like, and then the building suffers ruin due to war, a flood, or similar causes before the sub-contractor (al-mutaqāwil) delivers it to its owners—who is liable: the sub-contractor or the main contractor?
Answer — and with Allah is success: The matter is detailed as follows:
1– If the contract between the two parties specifies who bears liability—whether the sub-contractor or the contractor—then liability is according to that specification.
2– If there is an established custom among professionals in this trade, then liability follows that custom.
3– If there is an established custom for the contracting authority (such as the state), then liability follows that custom.
If none of the above apply, then by analogy the sub-contractor is liable: if the materials are supplied by the contractor, he is a shared hireling; and if the materials are supplied by the sub-contractor, he is a seller or like a seller. Both the shared hireling and the seller remain liable until they deliver what the contract was concluded upon.
What we have mentioned accords with the school’s analogy.
Yes, if the two parties reconcile in such a case, that is better and preferable.
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.2