I've spent a bunch of time trying to solve this scenario - it's been fun 🙂
I initially went down the xpath path (pun intended) but ended up with the following which I think should be what you are after (hopefully). Note that I haven't done any testing on large datasets, so not sure about performance.
I have the following arrays of objects:
Array A
[
{
"Name": "John Smith",
"CompanyID": 123,
"Email": "John.Smith@ABC.com"
},
{
"Name": "Grant Jenkins",
"CompanyID": 432,
"Email": "Grant.Jenkins@ABC.com"
}
]
Array B
[
{
"Name": "Andy Jones",
"CompanyID": 890,
"Email": "Andy.Jones@ABC.com"
},
{
"Name": "Johnathan Smith",
"CompanyID": 123,
"Email": "John.Smith@ABC.com"
},
{
"Name": "Mary Jones",
"CompanyID": 300,
"Email": "Mary.Jones@ABC.com"
}
]
The final output in this case would be:
[
{
"Name": "John Smith",
"CompanyID": 123,
"Email": "John.Smith@ABC.com"
},
{
"Name": "Grant Jenkins",
"CompanyID": 432,
"Email": "Grant.Jenkins@ABC.com"
},
{
"Name": "Andy Jones",
"CompanyID": 890,
"Email": "Andy.Jones@ABC.com"
},
{
"Name": "Mary Jones",
"CompanyID": 300,
"Email": "Mary.Jones@ABC.com"
}
]
The full flow is below. I'll go into each of the actions.

Compose A and Compose B contain the arrays of objects.

Select A IDs outputs a simple array of Company IDs from Compose A. The expression used is:
item()?['CompanyID']

Example output:
[
123,
432
]
Filter array B output will only include items from Compose B where the Company ID is NOT contained in the list of Company IDs (Select A IDs).

The advanced expression is:
@not(contains(body('Select_A_IDs'), item()?['CompanyID']))

Finally, Compose Combined joins both arrays using the union expression:
union(outputs('Compose_A'),body('Filter_array_B'))
