Short answer. Yes. Under Article 1718 of the Civil Code, a contractor who supplied only his work or skill generally cannot claim pay if the work is destroyed before delivery, but he can if the destruction was caused by the poor quality of the material, provided he communicated that fact in due time to the owner.
What the law says
cannot claim any compensation if the work should be destroyed before its delivery, unless there has been delay in receiving it, or if the destruction was caused by the poor quality of the material, provided this fact was communicated in due time to the owner
Civil Code, Article 1718 — Loss Where Contractor Furnished Only Labor. Read the full provision →
The general rule falls on the labor-only contractor
Where the contractor undertook to put in only his work or skill, the risk of the thing being destroyed before delivery normally sits with him. The law says such a contractor cannot claim any compensation if the work should be destroyed before its delivery. The reasoning is that he has not yet delivered what he promised, and the owner should not have to pay for a result he never received. That is the default, and it is why a labor-only contractor who simply sees the work ruined before turnover is usually left holding the loss.
The warning is what shifts the loss back
The article carves out an exception that fits your situation exactly. The contractor may still be paid if the destruction was caused by the poor quality of the material, provided this fact was communicated in due time to the owner. Two things must line up. First, the cause of the failure must be the bad material, not the contractor's own workmanship. Second, the warning must have been given in due time, meaning early enough for the owner to act on it, not after the damage was already done. A timely warning turns the owner's material choice into the owner's risk.
Why 'in due time' carries so much weight
The whole exception can be won or lost on the timing and proof of the warning. A contractor who quietly proceeds with material he suspects is defective, and only mentions it once the work collapses, has not warned in due time. The safe practice is to raise the concern in writing before or as the material is used, describe the specific defect, and keep the owner's reply or silence on record. Photographs of the material, the delivery documents, and any message flagging the problem are the evidence that later separates a paid claim from an unpaid one.
The separate rule for a fortuitous event
The provision also addresses a different cause of loss. If the material is lost through a fortuitous event, the contract is extinguished, meaning neither side continues to owe the other under it. That branch is about accidents beyond anyone's control, not about defective material, and it does not by itself pay the contractor. So the destruction's cause decides the outcome: poor material the contractor flagged points toward compensation; a pure fortuitous loss ends the contract instead. Identifying which one actually destroyed the work is the first thing to establish before demanding payment.