If you're doing shared hosting, it is extremely likely your provider has some sort of restrictions on the platform for what you can run. You can use this script to test if the function you are trying to use is restricted by that provider:
To dowload it via CLI:
curl -O https://raw.githubusercontent.com/philipjewell/scraps-and-scripts/master/function_check.php
Just swap out the FUNCTION_HERE
in the code with the function you are trying to test and run the script. Since this is a basic if/else statement, it will allow you to see if the function is able to fun on the server.
If you're using WP CLI, you can run the following command within the actual WordPress in case the function you're checking against is custom to one of your themes or plugins:
wp eval-file function_check.php --debug