By acting as pilot in command when not insured you are breaking the law.
Asking this question is like asking if the guy in the right hand seat is drunk can he log P1? If his medical is invalidated by a medical condition he has not yet disclosed to the CAA can he log P1?
Of course he can, but he should then expect to pay any fines, and have his licence removed if he ever gets found out.