The bug would rather be in case 3. It seems that %{ is difficult to get a grip on for many people, but it is intended to work like this: The argument (or result, in the case of sscanf) is an array of elements. _Each of these elements_ is an array of positional values, which match the various % operators _inside_ the %{. So to get the "bar" part, just add another %O. Of course, it becomes even more useful when you use different conversions:
Pike v7.6 release 13 running Hilfe v3.5 (Incremental Pike Frontend)
write("1: %{%s %07d\n%}", ({({"foo",3}),({"baz",42})}));
1: foo 0000003 baz 0000042 (1) Result: 27
In your case 3, the first element of a[0] is a string, not an array. So in this case I would have expected an error. But apparantly there is some kind of DWIM here, which of course confuses things.