The following query in eXist-db returns the wrong result:
for $x allowing empty at $y in ("a", "b", "c")[4]
return
$x || ":" || $y
The result should be :0, but eXist-db returns :1.
Rerence: https://www.w3.org/TR/xquery-31/#id-xquery-for-clause
Tested against eXist-db 7.0.0-SNAPSHOT.