unless the contract is made explicitly void by law
Yes, and my insurance is so.
I don't know if every UK aviation policy requires the flight to be "legal" (the wording is a bit longer than that, along the lines of complying with all licensing and airworthiness requirements) but I think most of them do.
Anyway, Haywards own most of the UK GA market