What to do with pages that do not exist? Redirect to the home page?
Google has it to himself, that non-existent pages can appear in the search engine's index long after they ceased to exist.
The most effective way to make the optimal, both for users and search engines, way to deal with non-existent pages, then apply redirects 301 non-existent addresses to identical ones, possibly as similar content as possible.
Such a solution may often turn out to be impossible due to the need to generate a huge number of redirects in the htaccess file. In this case, it is worth redirecting non-existent addresses to sections that are thematically similar to non-existent pages.
Redirecting non-existent subpages to the home page is not an error and does not adversely affect the height of the page in the search results. Lowering the position in search results may be the result of losing some of the page content (loss of content of subpages). Redirect errors 404 on the home page is also suboptimal due to the usability of the website.
Redirecting to the home page causes confusion for the user (cannot guess, that the page he tried to open does not exist).