This is why I encourage not overriding common commands in $PATH. Setup an alias instead so it only applies to interactive shells (or just type the new command :p).
Shell scripting is already fickle enough with compatibility issues across the major implemtations of POSIX utils (GNU, macOS/ BSD, Busybox). Even /bin/sh itself cannot be relied upon to behave consistently across platforms. Notably, Busybox's ash supports the non-POSIX substring syntax that Bash does. This won't work on distro's like Debian where /bin/sh is linked to dash shell.