Also for anyone stumbling over this with a fully dynamic case, I was stumbling through awkwardly nested MAP_CAT calls per the other answer here and realized I was just blanking on the fact that OBJECT_AGG existed.