In my magento2.1.5 (migrated from magento1.9) store, some configurable products are not showing any associated simple product in both admin and front-end. I need to set the simple products again in admin and then it is working good. This behavior is repeating in products that are migrated from magento1.9.
Strange thing is, when I get the children of that configurable product using the code below, it is not showing me the child products.
$children = $product->getTypeInstance()->getUsedProducts($product);
It looks like the simple products are associated but somehow Magento is not able to render this.
I also checked the values in the database and for most products having an issue, the value of "has_options" and "required_options" is set to 0. Changing it to 1 doesn't work for me.
These products were working fine earlier and are working fine on my older staging deployments. Can anyone please tell me what is the issue?