To export Color Table via scripting we are supposed to use this code (which doesn't work):
sTT = stringIDToTypeID; (dsc = new ActionDescriptor())
(ref = new ActionReference()).putProperty(sTT('color'), sTT('colorTable'));
dsc.putReference(sTT('to'), ref), executeAction(sTT('set'), dsc, DialogModes.NO)
It results as "Error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop. - The parameters for command "Set" are not currently valid.", but probably Tom Ruark may confirm the code is correct so it's a bug...
I tried it in Photoshop 23.3.1 but the same is in previous releases: