create table t (x jsonb);
insert into t values ('{"f":"b"}');
select distinct (x) from t;
ERROR: unable to encode table key: *tree.DJSON
This stems from the fact that we use the table encoding of datums to hash them in the distinct operator, which means that only types that are indexable will be able to be distinctable.