No, they don’t affect SEO ranking directly if it happens because of the wrong URL entered by a user. But if a page is moved or renamed, you risk losing the link weight of this page. Plus, if there are a lot of 404 errors, they use a crawling budget, meaning that the search engine bots will not reindex other pages.