Google Advice; How To Deal With Out Of Stock Items
Return a 404 if the product is permanently out of stock. Return a 200 if the product is temporarily out of stock. Return a 301 to equivalent content if the product is expired but you have reason to preserve SEO Benefits.