If you have made a custom error page you should make sure that an .htaccess rule for that page is created. You can either create the .htaccess rules by yourself or you can use the cPanel editor for the error pages located under cPanel -> Error pages. By accessing this feature you will be able to edit the content of your error pages. Note that after you save certain error page it will be added as a rule into your .htaccess file.

If you need to add your error pages as a rules in your .htaccess file the structure of the code should be as it follows:
ErrorDocument 404 /~your_cpanel_username/404.shtml

For every error code between 400 and 500 you can add such rule into the .htaccess file into your public_html folder.