with test as
(
SELECT key, value FROM jsonb_each('{"659": [false, false, false], "596": [true, true, true]}'::jsonb)
)
select key::integer, value::boolean[]
from test
SELECT key, array_agg(val)
FROM (
SELECT key::integer, jsonb_array_elements_text(value)::boolean AS val
FROM jsonb_each('{"659": [false, false, false], "596": [true, true, true]}'::jsonb)
) AS t
GROUP BY key