gcloud app deploy cannot find app.yaml if go.mod is in a different directory

I just found a workaround while posting this question. Initially, this seems to be working:

gcloud app deploy --appyaml=app.yaml

However, after about 30 minutes the deployment always fails with the following error:

Updating service [default] (this may take several minutes)...failed.                                                                                  
ERROR: (gcloud.app.deploy) Error Response: [13] The system encountered a fatal error

The deployed version seems to be running but it returns HTTP 404 for any request. After stopping and restarting the version in the Console, it's still non-functional: it returns mostly HTTP 502, and sometimes HTTP 503 and "Service error -27". I can see in the logs that /readiness_check calls all fail with 503, failReason:"null"