I'm having this issue also in my "Run ci_post_clone.sh script" step. I've beenseeing it since last friday (May 5th 2023). Here is th log. It happens during downloading packages, but every time it's with a different package.
[!] Error installing GoogleUtilities
[!] /usr/bin/git clone https://github.com/google/GoogleUtilities.git /Volumes/workspace/tmp/d20230508-7885-fjz83v --template= --single-branch --depth 1 --branch CocoaPods-7.11.0
Cloning into '/Volumes/workspace/tmp/d20230508-7885-fjz83v'...
error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502
fatal: expected flush after ref listing
It seems like there might not be enough memory on the machine for downloading the library?
If anyone on apple's side is looking into this, my log summary is here