Its a dynamic error, if @href is not a valid uri.
Test ab-p-document037.xml is expected to fail with error code err:XD0064 [Core steps, XProc]
.
<p:declare-step xmlns:err="http://www.w3.org/ns/xproc-error" xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
<p:output port="result"/>
<p:identity>
<p:with-input href="%gg"/>
</p:identity>
</p:declare-step>
Additional tests for p:document.