Problem solved!!
It turns out that the problem was that the path to the folder Hazel is scanning has a space in one of the folder names. That was causing the script to fail in Hazel even though the same command worked fine from the Terminal command line (where the spaces get escaped properly).
Here's the final, working version of the Hazel rule which includes quotes around the $1 to account for the spaces in the path.

Thanks to a_freyer and Mr_Noodle for their patient assistance. Perhaps you could update your post in the tips forum with the quoted version of the script, a_freyer.