GroundPrimitive changes color is invalid

var position = [
            114.29010064082411, 30.522155241866095, 12.192509329864926,
            114.2894367759643, 30.52209573932653, 12.167660878178367,
            114.28944467449023, 30.521907893294372, 13.154909079307632,
            114.28958337418399, 30.521921295101574, 20.482150586580136,
            114.28959345219904, 30.5218911993581, 20.444588971186523,
            114.28975839175087, 30.521912462788823, 20.494230633074,
            114.28974790990745, 30.52196110344785, 20.54178919835006,
            114.2899421359849, 30.521980985811425, 20.486840795003793,
            114.28995548935166, 30.52192087304588, 20.41184873724211,
            114.29010644513384, 30.52194726420563, 20.92692201328516,
            114.29009027126298, 30.52199680354543, 20.52123721010736,
            114.2902250174015, 30.52201457737059, 20.541077803887923,
            114.29019474708731, 30.522168858573746, 12.334415883228441,
            114.28983184978196, 30.522132258904428, 12.29246862650628,
        ];
    var groundPrimitiveInstances = ;
    var groundPrimitiveInstance = new Cesium.GeometryInstance({
        geometry : new Cesium.PolygonGeometry({
            polygonHierarchy : new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(position)),
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
        }),
        id : '123',
        attributes : {
            color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromAlpha(Cesium.Color.RED, 0.4)),
        }
    });
groundPrimitiveInstances.push(groundPrimitiveInstance);
var groundPrimitive = viewer.scene.primitives.add(new Cesium.GroundPrimitive({
    geometryInstances : groundPrimitiveInstances,
    appearance: new Cesium.PerInstanceColorAppearance({
        translucent: true
    })
}));

var handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
handler.setInputAction(function (movement) {
    
    var pickedObject = viewer.scene.pick(movement.position);
    var attributes = groundPrimitive.getGeometryInstanceAttributes('123');

    attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.YELLOW);
    console.log(attributes)
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);

I tried again and found that when the length of the geometryInstances array is 1, changing the color can take effect. When the length of the geometryInstances array is greater than 2, changing the color will be invalid.

It looks like this is because GroundPrimitive uses ClassificationPrimitive, which only supports the same color across all instances:

https://cesiumjs.org/Cesium/Build/Documentation/ClassificationPrimitive.html

The ‘color’ in this array is what prevents it from allowing you to do this:

You can see it gets set when there’s more than one instance: