Bug? 'nice time' disables $PATH search
The problem here is that the handling of ~ differs between the shell and the macOS kernel. If you run your command directly from the prompt, PATH expansion is handled by the shell which knows how to expand ~. If you run your command through nice, the command is passed to the macOS kernel for path expansion:

pse@Mithos:~$ mkdir foo
pse@Mithos:~$ cat &gt;foo/foo.sh
#!/bin/sh
echo foo here
pse@Mithos:~$ chmod +x foo/foo.sh
pse@Mithos:~$ foo/foo.sh
foo here
pse@Mithos:~$ PATH='~/foo':$PATH
pse@Mithos:~$ echo $PATH
~/foo:/Users/pse/.bin/script:/Users/pse/.bin/i386:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin
pse@Mithos:~$ foo.sh
foo here
pse@Mithos:~$ time foo.sh
foo here

real    0m0.007s
user    0m0.002s
sys 0m0.002s
pse@Mithos:~$ nice time foo.sh
foo.sh: No such file or directory
        0.00 real         0.00 user         0.00 sys
pse@Mithos:~$ nice foo.sh
nice: foo.sh: No such file or directory
pse@Mithos:~$ 


To avoid this, always make sure that your assigned PATH contains neither ~ nor any nonexpanded variables.

PS: Additionally there are different time commands called for time foo and nice time foo.  To get the same output format in both cases, use /usr/bin/time foo instead.