Well, that probably checks that it a top level component (frame or form / but frame, only if not embedded on a form).
Because once a frame is embedded into a form, then the form already writes the lcl version.
But, afaik in the docked form editor the form has a parent.
If that is what is causing it, then that is a bug. (and there must be some better check / I.e. if the parent is csDesigning)...
IIRC, but I can't recall there is some function for that already... (might not check that flag, but another, but would serve the purpose)