Thanks for letting us know. I moved to a new topic since your environment is different to the original post. Instead of changing the user, you can also run a single command as a different user:
That only works when you are in the folder where the occ file is (and that is where nextcloud is installed). For FreeBSD this can be in /usr/local/www. For Linux-like systems it is often within /var/www/..., in the worst case you need to use some file search tools (find, locate, …)
You have installed Nextcloud at /root? What is in that occ.sh (normally this occ is also a php file, like other code from Nextcloud, perhaps it’s something from the jail environment)?