When you have links in your authorities that point to a non-existing authority or where the search for the term gives no results a 404 error is shown. Instead it should show a nice 'no results page' telling the user that no result was found.
Still an issue in 3.18.3 and current master. Very common in our catalogs as the authorities from the union catalog may contain references to other authorities that are not part of the library's collection.