This error means that the server the daemon is connected to at that time is experiencing issues / possible downtime etc.
You need to handle it in your code if you want better reliability.
The simplest solution I've found is whenever this happens to restart the daemon as it will grab a working server when it starts.
Alternatively you can keep a list of servers you trust and rotate manually (see electrum daemon -s) when server errors occur.
