Just don't play
It happened the second time.

If half of all connection problems are server-side, half are not. And it isn't always easy to tell which is which.

I was connected to the internet. The ChessCom server probably just died.
There doesn't appear to have been a server issue around the point you posted and most like was a connection issue between you and the live server
If this keeps happening to you over not that long of a time period, I'd assume it's a problem with the client(as in your browser or something), wifi, or computer. That's just my take on this though.
You already know it. Try to keep your rating.