<json type="object"><b type="number">1</b><a type="number">3</a></json>
As you see, the standard function returns keys not in the order as it was set in the original JSON string. I didn't find any requirement in xQuery spec that the resulting map entries should be sorted by the key name.
Is it a bug or a feature?
If a feature I would be really happy to see one additional param to preserve key ordering.