To fix this bug, replace the vendor/magento/module-configurable-product/Model/Product/Configuration/Item/ItemProductResolver.php
file with the following one:
github.com/magento/magento2/blob/3ef388525/app/code/Magento/ConfigurableProduct/Model/Product/Configuration/Item/ItemProductResolver.php
The bug is fixed by the following commit: