With the lock kept for a layer of another comp and nothing selected in the active one, ui.set {effectControlsLocked: true} reported success. It now returns the documented error and leaves the kept lock alone.