A number of scenarios may cause the cURL to time out in WordPress.
For instance, a WordPress firewall plugin like Cloudflare may block a REST API request because it considers it to be suspicious activity.
If your DNS server is not working correctly, then this may also fail HTTP requests and cause the cURL timeout error in WordPress.
A poorly configured WordPress hosting server may simply have a very low connection timeout threshold that stops certain WordPress processes from running properly.