What became of SubPlan 1? Maybe this is fine but it looks a little shaky. We should at least run down why that's happening and make sure we're not leaving dangling pointers anywhere.
I did some debug on this. The 'SubPlan 1' is not explained because its SubPlanState is not created and added to AggState->subPlan.
When we compile each tlist column for the agg node, the GroupingFunc expressions would not be collected to AggState->args, because only Aggref nodes are expected there. As a result, the 'SubPlan 1', as the arg of the GroupingFunc node, does not have a chance to be initialized by ExecInitSubPlan() and added to AggState->subPlan when evaluating arguments to aggregate function in ExecBuildAggTrans().