This is where the magical FILTER function really shines. It will take the array inputs and give us array outputs, without needing an array formula designation.
Add in the FILTER function so that our formula in cell B2 looks like this:
=FILTER(A2:A,ISNA(XMATCH(A2:A,D2:D)))
And voilà!
Source: Comparing Two Columns by Ben Collins
—
I have never looked at XMATCH. Another one to explore.