In the end I've inverted the query (to return touched answers) using the following:
where("(document::jsonb - 'name' - 'secondary_name') <> '{}'::jsonb")