If sold out products just vanish from your listings, it'll hurt your SEO, seeing as any links or google searches will bring customers to a 404 page not found instead of the product.
Having the items marked as out of stock and still visible will not harm any SEO work you've done for that product, and it shows potential customers that you have more products and that they are selling.
So in my opinion, best having out of stock products marked as out of stock, and still showing up on your website

it saves you from having to re-do any SEO work, everytime an item is back in stock