If the gcloud compute config-ssh
doesn't work check the firewall rules for your machine; find the VPC it's in and make sure port 22 is open - it may happen it's blocked.
If you're not sure if SSH can come through create a rule for it.
Very similar issue was also discussed in this topic on StackOverflow which might help you.
You can (to be absolutely sure SSH traffic is allowed to your VM) set up a startup script for it: edit the VM in question and find "Custom Metadata" section and click "Add Item", next type startup-script
as a key and the command sudo ufw allow ssh
in the "value" field.
Having the SSH traffic enabled in the GCP firewall and the VM itself you should be able to log in.