
When you are careful you can often prevent these toggles from making your palette disappear instead (by planning to not have it active when it likely gets toggled), but I have not yet found a fail safe method (in many years using actions) ...
Am I missing something, or are they making our life difficult...?

I'd like to have a "show" command besides "toggle"...
I'm now implementing a few with an event script, so more options may be available...?
For example, can I check if that palette is already active/foremost to decide if I still have to toggle it?
(I'm interested to know this for Paths and Layer Comps)
I can also have a "Close Document" event script that makes things safer by making sure my default palettes are left visible again, but here is one example of a gotcha...:
When opening a document with more than one layer, I like the Layer Comps to pop into view (cause I often forget that I made some).
Now, when executing the following code I can have my palette disappear if I "quickly" open two consecutive multiple layer documents...
I can always make silly workarounds to diminish risk some more, but it has never been completely fail safe so far...
P.S. Finally tried xtools as well. Some handy stuff

Some of the descriptions in ActionToJavascript.jsx made me hope the code was gonna be short and native, but it is quite verbose... (but a lifesaver of course

#target photoshop
if ( doc.layers.length !== 1 ) {
// toggle Layer Comps palette (code produced by xbytor's ActionToJavascript.jsx in xtools)
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
function toggleLayerComps() {
// Select
function step1(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Mn '), cTID('MnIt'), sTID("toggleCompsPalette"));
desc1.putReference(cTID('null'), ref1);
executeAction(cTID('slct'), desc1, dialogMode);
};
step1(); // Select
};
toggleLayerComps.main = function () {
toggleLayerComps();
};
toggleLayerComps.main();
}