This will of course return the two rows with that category. But I also want to be able to run the query with a non-existent cat and get a result of "null" for the id.
untested
SELECT unnest( ARRAY( (
select id from my_table where cat = 50
) ) );
tested, self-contained, example:
SELECT unnest(ARRAY((SELECT col FROM ( VALUES (1), (2) ) vals (col) WHERE true)))