What about contract law? Every insurance policy I've ever seen has a clause stating that it only covers drivers with a 'valid licence.' Could they not invalidate the policy because you broke that condition?
As I understand it, there is an overriding piece of legislation which means that they cannot refuse a third-party claim, regardless of any conditions in the contract. So long as you have a policy in your name, they
must honor any third-party claim regardless of whether you breached any conditions of the policy. They can refuse to pay out for anything else, such as damage to your own vehicle on a comprehensive policy, theft of items if you left the doors unlocked, etc.
I've seen this point raised in a police forum in the past, and the consensus was that while a prosecution could take place for "driving otherwise than in accordance with a licence" and for any other relevant breaches of the law, they could
not prosecute for uninsured driving, since the third-party cover (which is all that is legally required) is still effective.