These are ok:
select json_query('{"a": 1, "b": 42}'::jsonb, 'lax $.b' without wrapper);
json_query
------------
42
select json_query('{"a": 1, "b": 42}'::jsonb, 'lax $.b' with
unconditional wrapper);
json_query
------------
[42]
But this appears to be wrong:
select json_query('{"a": 1, "b": 42}'::jsonb, 'lax $.b' with conditional
wrapper);
json_query
------------
[42]
This should return an unwrapped 42.