I was able to repeat your problem with a new instance of the virtual machine, getting the same error. Here are some steps I took to fix the problem:
Make sure that you are authenticated and have rights to both projects with the same account!
$ gcloud config list (if you see the @ developer.gserviceaccount.com service account, you need to switch to the account included in both projects, you can check this from the Devlopers Console> Permissions)
$ gcloud auth login (copy the link to a new window, log in, copy the code and paste it back into the invitation)
$ gcloud compute copy-files test.tgz --project stack-complete-343 instance-IP:/home/ubuntu --zone us-central1-a (I would also use the instance name instead of IP)
This last command should also generate your ssh keys. You should see something like this, but don't worry about entering a passphrase:
WARNING: [/ usr / bin / ssh-keygen] will be executed to generate the key.
Creating a public / private rsa key pair
Enter a passphrase (blank for passphrase):
source share