Why don't you add a line before your system call...
print "find $home[$i]$dir -user $UID -print | xargs -n 1 chown -h $NEW
+UID\n";
system("find $home[$i]$dir -user $UID -print | xargs -n 1 chown -h $NE
+WUID");
Now you can see what it's expanding into with the variable interpolation. I'm guessing the variables aren't expanding into what you think they are.
Edit: Fletch's response to this node points out the dangerous situation that my suggestion can lead to. I'm leaving it in place as it's a valuable lesson to be learned.