Using Server Side Includes the error pages can be modular; multiple pieces reused.
The intention of the CGI script is, likely, for the hosting company to “log” the fact that error occurred.
Please realize 404 is just one of numerous [types of] errors server software can raise and many hosting companies include default pages to cover the most common.