packet_write_wait: Connection to <<EXTERNAL IP>> port 22: Broken pipe
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].Here are a few steps you can try:
1. I see that you have tried to edit ServerAliveInterval. Please try to edit the ~/.ssh/config file in the client system (which is your MAC computer) to adjust the ServerAliveInterval and ServerAliveCountMax also. Please restart the system after editing the config files. More information about this topic can be found is these third-party links [1], [2] & [3].
2. If the above fails, in order to isolate the issue between source,network and target, you can perform the following tests.
a. Could you please try from a different network to see if the problem still persists?
b. Does issue persist if you use a different client.
C. If you spin up a new VM, does issue persists?