I discovered a trick that you can use to avoid this issue. The wonkiness happens because the palettes are arranged in alphabetical order but any custom palettes aren’t taken care of properly. By making sure that the custom palettes are always last in the list the wonkiness disappears.
If you start each palette name with a ~ (tilde) then ZBrush puts the custom palette after the ZScript palette and all is well. The ~ also doesn’t show in the palette name so if you call a palette ~Sculpting it will appear on the UI as Sculpting
For some keyboards it will be necessary to use a different key to get the ~ to show in the naming box. For example, on the UK keyboard it’s the @ key.
HTH,