whenever I define the type of a parameter as xs:anyURI and pass a string to it, I get the error "Cannot convert xs:string to xs:anyURI".

It might comfort you to hear that the behavior is indeed compliant with the spec. As it would take some time to recite the reasons for this, feel free to scan the following sections:

https://www.w3.org/TR/xquery-31/#id-function-conversion-rules
https://www.w3.org/TR/xquery-31/#promotion

I should have added, that this also does not succeed:
> ...
>
which leaves me even more baffled.  

Me too, because the following query works on my environment:

  declare variable $local:uri1 as xs:anyURI :=
  $local:uri1