If a replacement roof was not permitted as required, and the contractor used shoddy material and/or the worker’s violated codes, an insurance claim for damages to the roof potentially can be denied.
Now you are changing parameters.
First it was just lack of permit that could cause a claim to be denied and that's wrong.
Now it's lack of permit, shoddy material and/or code violations that could cause a claim to be denied.
Since I have refuted the lack of permit thing let's just talk about shoddy material and/or code violations.
Yes, there is an exclusion that could remotely apply to some claims. I'll quote the whole thing for you:
We do not insure for loss to property described in Coverages A and B caused by any of the following. However, any ensuing loss to property described in Coverages A and B not precluded by any other provision in this policy is covered.
3. Faulty, inadequate or defective:
a. Planning, zoning, development, surveying, siting;
b. Design, specifications, workmanship, repair, construction, renovation, remodeling, grading, compaction;
c. Materials used in repair, construction, renovation or remodeling; or
d. Maintenance;
of part or all of any property whether on or off the "residence premises".
For one thing, any of those can happen with or without a permit so a claim denial for no permit isn't going to happen.
As for the four excluded items, they would have to be the proximate cause of the loss for the exclusion to be evoked and only if the ensuing loss was not precluded by any other provision of the policy.
Fire, wind, hail, falling objects, and any other covered peril would not be denied even if any of those 4 elements existed because those perils are not precluded by any other provision of the policy.
I can't read your mind, only what you wrote, but what you wrote implies that you have somehow come to believe that if a windstorm blows the roof off, or another covered peril damages the roof, that the insurance company would deny the claim if the roof was installed without a permit or the contractor used shoddy material and/or the worker’s violated codes. Nope, not correct.