I enabled debugging but I still get the same message: There has been a critical error on your website

Fatal error handling has been introduced in WordPress 5.1 and 5.2. also known as “Screen Of Death (WSOD) protection.”
To exclude this “protection” and restore the old way error catching you should add this to your wp-config.php file since WP_DEBUG true is not enough to disable the WSOD protection :

define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );