Are you asking if this gives you a defence?
Yes, you can cancel your insurance.
That would not stop them voiding it though potentially. They are likely to still investigate the matter.
But nobody can stop you cancelling your insurance.
Can I clarify anything for you?
They won't prosecute you for driving without insurance.
You were insured.
The company may well have dishonoured any claim made but that is different to being uninsured.