In my experience insurance companies just ask you a bunch of big-picture or specific questions (eg swimming pool), reserve the right to inspect even though they never do, and then jack the rates rather than trying to grok more unknowns.
I've never read an insurance policy where anything like this is explicitly mentioned. I suppose there is a legal path of being criminally charged by fire investigators for having performed unsafe wiring (non-Listed power handling equipment as part of the fixed wiring), and then the insurance company denying you because of that criminality. Or in states where DIY wiring is not illegal, perhaps declaring that the wiring itself is "illegal" (as it goes against the NEC (despite the NEC not being openly published as we generally expect from laws!)) and then hanging their hat on illegality regardless of criminality? But does any of this happen in practice?
Surely if insurance companies were concerned about fires caused by dodgy electronics, they'd address all of the people using non-NRTL-tested GENSYM brands from Amazon et al? They've got no ability to post-facto deny based on this (said devices aren't illegal), but they could surely make it an explicit condition of policies.