Caldav connection fails unless diagnostics enabled

Yes, this truly is weird.

I often find my CALDAV/CARDAV accounts red triangeld with a conection failure. restarts, reboots nothing solves it. So I turn on diagnistic logging et voila the connection instantly succeeds.This persists for a while and then (presumably when the logs fill up) it stops working again. I turn off logging and again, the account pops back into life.

What is happening during the “turn on/off diagnostics” that can be fixing the connection errors?