The vCloud VM always has a moRef. Are you sure that the array contains vCloud VM Objects ? ? Have you tried your script with a single vCloud:VM object ?
I am using exactly the same script to get a vCenter VM from vCloud VM.
var vmmoref = vCloudVM.getVMVimRef().moRef;
var xpath = "xpath:id='"+ vmmoref +"'";
var vms = VcPlugin.getAllVirtualMachines(null , xpath);
vm=vms[0];