I'd like a lock function, too.
Lacking that, the easiest way I've found to restore things is to simply go to Windows | Palette Layout | <your named layout>
This of course only works if you have defined, or redefined, your palette layout scheme in the Work Environment (Options menu).
Karl
One of the forum moderators
AC 28 USA and earlier • macOS Sonoma 14.7.1, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB