Operation timed out after 0 milliseconds with 0 out of 0 bytes received
I would suggest trying to isolate the issue. For example, assuming that the server you are trying to reach is on GCE and your PHP application is outside of GCP, You can parallel run the application on GCE and compare the results. In that way you discard the network elements outside Google.
You might also want to check that you are not running out of resources in the machine where the PHP application is running or the one that is serving the requests.
Finally, to discard that it is not an issue related to your PHP configuration, you can also try to log and curl via a Linux script. Then you can compare results. By the way, you can find here a discussion on PHP curl timeouts.