When I use the below code to load out of products in the collection.it is not able to fetch out of stock product. It depends on catalog > inventory > display out of stock product
How can ignore this setting in below collection
$data = \Magento\Framework\App\ObjectManager::getInstance()->create(‘Magento\Catalog\Model\ResourceModel\Product\Collection’)
->addAttributeToSelect($this->getUsedMagentoAttributes())
->addIdFilter($product_ids)
->setStore($this->_storeModelStoreManagerInterface->getStore())
->addStoreFilter()
->addMinimalPrice()
->addFinalPrice();
$data->setFlag(‘has_stock_status_filter’, false);
$data->load()
->addCategoryIds();