Marko,
The problem is that you're updating the caption instead of the new number property on the block. If the number property is set (which is read/write), that value is used instead caption.
You can see how the xreftext for a block is resolved here:
You can see the (local) caption property is only used as a fallback now.
-Dan
p.s. I eventually want to get rid of caption as a stored property on the block because it's a total abuse of the term. The caption should only be computed, like the xreftext. However, the transition is going to be a bit painful as the legacy terminology got so deeply entrenched.