The Safe\shell_exec function currently throws an exception when null is returned from \shell_exec. A null return is not always equal to an error occording to the docs.
https://www.php.net/manual/en/function.shell-exec.php
This function can return null both when an error occurs or the program produces no output. It is not possible to detect execution failures using this function.