The error appears whenever: the cell layer name L <name>; is changed to a new layer name not yet present in the file (while opened) and reloading it in KLayout.
The error does not occur when closing and re-opening the file.
Tested in KLayout Viewer and Editor 0.25.8 and 0.25.9
Internal error: ../../src/db/db/dbLayout.cc:1616 m_layer_states [index] == Free was not true (line=2, Cell=C1)

Minimum working example
DS 1 100 1;
L L0;
B 100 50 0 0;
DF;
E
LayerTest.zip
Steps to reproduce
- Open file in KLayout
- Change the layer
L L0; to something else (example L L1;)
- Save the file
- Confirm reloading the file in KLayout