There is small update in query
insert into `inventory_source_item` (source_code, sku, quantity, status)
select 'default', sku, qty, stock_status from (`cataloginventory_stock_status` as `lg` join `catalog_product_entity` as `prd` on ((`lg`.`product_id` = `prd`.`entity_id`))) ON DUPLICATE KEY UPDATE quantity = VALUES(quantity), status = VALUES(status)