2 added 385 characters in body
source | link

Enabled the products and changed their visibility to Search.
Next Set Display Out of Stock Products to yes under Store -> Configuration -> Catalog -> Inventory -> Stock Options.

Update

The product will not appear in the catalog because the visibility is set to Search. To make a product visible in the catalog visibility should be either Catalog or Catalog/Search.

To change the visibility of multiple products together, you can use the Magento Import functionality.

Enabled the products and changed their visibility to Search.
Next Set Display Out of Stock Products to yes under Store -> Configuration -> Catalog -> Inventory -> Stock Options.

Enabled the products and changed their visibility to Search.
Next Set Display Out of Stock Products to yes under Store -> Configuration -> Catalog -> Inventory -> Stock Options.

Update

The product will not appear in the catalog because the visibility is set to Search. To make a product visible in the catalog visibility should be either Catalog or Catalog/Search.

To change the visibility of multiple products together, you can use the Magento Import functionality.

1
source | link

Enabled the products and changed their visibility to Search.
Next Set Display Out of Stock Products to yes under Store -> Configuration -> Catalog -> Inventory -> Stock Options.