This problem is caused by a Theme that added this WP code/constant: define('WP_MEMORY_LIMIT', '512M');
at the bottom of the wp-config.php file after the require_once(ABSPATH . 'wp-settings.php');
code in the wp-config.php file. No code is supposed to go after this line of code in the wp-config.php file. All custom code in the wp-config.php file needs to be above this line of code.