Not if your insurance company finds out you altered the construction in any way violating the codes that can be directly attributed to the loss of the structure.
Better check the fine print
Pops sold insurance for 50 yrs. Seen him walk into a restaurant built out of converted antique rail cars cobbled together. Had lunch, walked around, went up to the owner and told him - "No one will underwrite a $250,000 policy on this structure"
The problem there is, the insurance company doesn't know whether you altered a structure, if the previous owner altered a structure, or if it was built that way originally.
When we bought out house and I talked with our agent. Back at that time, no one ever came to the house and checked things out on a personal basis. The agent had access to the tax records through the Auditor which shows the basics of the property. When I switched insurance companies, it was the same thing. This year, when I wanted to make sure that we had adequate coverage, it took quite a bit to get our agent to come out and see the property for himself.
Our house garage, when the house was built, the garage was completely finished off in OSB. No 5/8" drywall between the garage and the house shared wall. When we bought it, there was no problem getting insurance. I have since drywalled over the OSB.
So to say that an insurance company WON'T pay because things are the way they are, is a fallacy. If it was fact, then anytime that anyone switched insurance companies, that company would come out and go over things with a fine tooth comb. They might refuse to pay if things are very suspicious as far as a fire goes, but if you have a grease fire in the kitchen and it spreads to the rest of the house and totally destroys it, they are not going to refuse to pay out because you have OSB on the walls or something completely irrelevant to the cause of the fire.
When it comes to building a house, Building Codes change yearly if not monthly. An insurance company isn't going to refuse to pay out because of a fire today because of how a place was built and wired 50 years ago. If it is suspicious they may refuse to pay, but if it is a legitimate tragedy, you won't have a problem.