kicad-cli fails to resolve hierarchical sheet instances in v10

Description

Hierarchical schematic with multiple instances of the same sub-sheet. Components annotated with offsets of 100 per instance.

kicad-cli appears to not fully resolve the hierarchical instance tree on load, causing all downstream operations to operate on incomplete data. The GUI loads the same file correctly. PCB round-trip works correctly from the GUI, proving data integrity. Instance blocks in the .kicad_sch are correctly and fully populated.

The issues are:

  • kicad-cli sch export bom only exports one instance (first one) of each sheet and gives: Warning: schematic has annotation errors, please use the schematic editor to fix them while I cannot find issues with my design (PCB sync round trip works fine) BOM export through the GUI works fine.
  • kicad-cli sch export netlist shows the same warning. I cannot diagnose much since I do not fully understand the format. Netlist from GUI works and diff shows little overlap between the files.
  • kicad-cli sch export erc shows >2000 errors all hinting at unresolved hierarchy. A lot of floating nets on the top level and a lot of multple net name errors on sub-sheets. ERC in the GUI is clear.

#23172 concludes that incomplete netlist on a subsheet is a feature, not a bug, but I am explicitly running on the root schematic document so the issue is maybe related but I don't think the conclusion holds.

I have also tried jobsets but could not get anything conclusive out of it.

Steps to reproduce

I cannot share my exact project due to IP reasons.

  1. Create a hierarchichal design with multiple instances of the same sheet.
  2. Perform ERC, BOM export, netlist export from the GUI. Everything should work as expected.
  3. Perform ERC, BOM export, netlist export from the CLI. Symptoms above should show.

I will attempt to create a minimum working example and attach it to the issue but maybe someone more knowledgeable/experienced could look into this.

KiCad Version

Application: KiCad x64 on x64
Version: 10.0.3, release build
Libraries:
    wxWidgets 3.3.2 
    FreeType 2.13.3
    HarfBuzz 12.3.0
    FontConfig 2.17.1
    libcurl/8.18.0 Schannel zlib/1.3.1
Platform: Windows 11 (build 26100), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    Date: May 14 2026 13:33:37
    wxWidgets: 3.3.2 (wchar_t,STL containers)
    Boost: 1.90.0
    OCC: 7.9.2
    Curl: 8.18.0
    ngspice: 46
    Compiler: Visual C++ 1944 without C++ ABI
    KICAD_IPC_API=ON
    KICAD_USE_PCH=OFF
Locale: 
    Lang: en_GB
    Enc: UTF-8
    Num: 1,234.5
    Encoded кΩ丈: D0BACEA9E4B888 (sys), D0BACEA9E4B888 (utf8)