The cause of the error page being shown can be caused by either a JavaScript error or an error in PHP during the AJAX request.
For JS errors see if you see any errors reported in console.
To check for PHP errors see error logging here https://codex.wordpress.org/WP_DEBUG