@yitwail ‘s answers solved it for me. Removing the variable-name $acf
made the error go again. My error was:
Fatal error: Uncaught Error: Call to a member function is_path_valid() on array in '/app/public/wp-content/plugins/advanced-custom-fields-pro/includes/api/api-helpers.php:296'
and
Fatal error: Uncaught Error: Call to a member function init() on array in '/app/public/wp-content/plugins/advanced-custom-fields-pro/includes/api/api-helpers.php:296'