The error is definitely a DNS issue. Maybe it is intermittent? What happens if you try to visit https://api.cloud.com in your browser? You should get a message like this
{ "statusCode": 500, "message": "Internal server error", "activityId": "74b8b944-9a1e-41b2-a0df-35d5f99902e3" }
If you type host api.pcloud.com in the terminal does that always work?
Could there be a firewall or proxy blocking connections?