Detach disk uses disk name instead of device name, these can be different. From docs[0]: DeviceName: Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk.
Detach disk uses disk name instead of device name, these can be different. From docs[0]: DeviceName: Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk.
[0] https://cloud.google.com/compute/docs/reference/rest/v1/instances/get