Since you are adding MTL_SYSTEM_ITEMS_B, make sure it is picking from specific inventory organization.
In the above query add 'l.organization_id', you will know what i am talking about.
'l' alias has org_id and not organization_id.
Since I am joining MTL_SYSTEM_ITEMS_B I want to take the organization_id but no such tables has it for join
What i meant above was b.organization_id. Any way add below
AND h.ship_from_org_id = b.organization_id
AND l.ship_from_org_id = b.organization_id
If it worked, Mark it as helpful/correct to close this thread.