I think Saxon is behaving correctly by raising this error.
I guess this was error code XQTY0086, and locating that error code in the XQuery spec may shed some insight. The equivalent error in XSLT is XTTE0950. I prefer the explanation there (because I wrote it):
When attribute nodes are copied, whether with xsl:copy or with xsl:copy-of, the processor does not automatically copy any associated namespace information. The namespace used in the attribute name itself will be declared by virtue of the namespace fixup process (see 5.7.3 Namespace Fixup) when the attribute is added to an element in the result tree, but if namespace prefixes are used in the content of the attribute (for example, if the value of the attribute is an XPath expression) then it is the responsibility of the stylesheet author to ensure that suitable namespace nodes are added to the result tree. This can be achieved by copying the namespace nodes using xsl:copy, or by generating them using xsl:namespace.
You're copying the xsi:type
attribute, whose value is a QName, to a new element. Generally you can copy any validated subtree to a new parent tree and it will remain valid, so it can retain its type annotations. But the validity of a QName depends on the in-scope namespaces, so that isn't guaranteed in this case: it can be valid in its old location, and not valid in the new location. If you copied the containing element, that would work, because it would copy the namespaces, but copying the attribute without the namespaces creates the risk of leaving things inconsistent.
Saxon 9.7 is quite a while ago; I would have to do some digging to determine the detail, but this change is almost certainly a bug fix, quite possibly in response to a bug being fixed during XSLT/XQuery standards development.