When xsl:number level="any" is used to number a node, it tries where possible to compute the result by adding one to the computed number of the last node that was numbered by the same instruction. There are various checks to ensure that this strategy is safe, but these checks are incomplete. In particular, the strategy is unsafe and causes incorrect results when there is a "from" pattern.
This bug has been present in the product since time immemorial. It will be fixed by patch in Subversion on the 9.0 and 9.1 branches.