I didn't notice that in your script.
A VMDK file is actually 2 files (at least), there is the VMDK file itself, which is a type of header file.
It contains information about the vDisk. In fact you can display the content of that file, it's a text file.
The 2nd file is the file with the -flat suffix in there, that is the file that holds the actual content of the vDisk.
You need both of these to have a working vDisk.
When you start doing snapshots, changed block tracking... there are additional files that make up the vDisk.