input_4.xml seems to be indented. In other words, it seems to have whitespace-only text nodes between elements.
Since x:param/@href keeps whitespace-only text nodes intact, $global-context-item has whitespace-only text nodes as they are in input_4.xml. In the expected result (right side) in your screenshot, "\n..." represents those whitespace-only text nodes.
I don't know what your mode="enable.tuplet.nums" is doing, but I guess it's implicitly or explicitly discarding whitespace-only text nodes inside <dir>. The actual result (left side) in your screenshot has no whitespace-only text nodes represented by "\n...".
When XSpec compares the actual result and the expected result, all nodes are considered as significant. Whitespace-only text nodes are not ignored. Your actual result has no whitespace-only text nodes, but your expected result has some. XSpec compared them, found them different and declared Failure.
For more details about whitespace-only text nodes, see
https://github.com/xspec/xspec/wiki/Whitespace-only-Text-Nodes
Hope this helps,
AirQuick