Eagle importer: "reconnect" nets is broken / misses nets

Description

Eagle schematics have a flat (global) net name space, and every net is assigned a unique name.

When KiCad imports an Eagle schematic, inter-sheet connections are kept unchanged and generate global labels. Connections local to a sheet are converted to local labels, i.e., a "/" is added to the connection name.

This "reconnection" process breaks on a simple board, see below.

Related issues: #14620 (closed), #13571

Steps to reproduce

  1. Import the attached Eagle 7.x project (It's version 7.x due to #18515 (closed) )

    • Use “Import Non-KiCad Project” and save to new folder.
    • “Edit Mapping of Imported Layers” window: use Auto-Match Layers
    • Save schematic. Save PCB.
    • File > Export > Footprints into a new “project specific” library.
    • Open “Manage Footprints Library” and correct the library’s nickname (so it matches the nickname used in schematic to link to footprints). Refresh.
    • Now: “Update PCB from Schematic” (F8).
      • Check “Re-Link footprints” (once, i.e., for this update run only). Reason: Otherwise, existing footprints will be removed and need to be placed manually again.
  2. Observe messages in "Update PCB from Schematic" dialog:

    Reconnect via from PAC to /PAC.
    Reconnect via from FAC to /FAC.
    Reconnect via from GATE to /GATE.
    Reconnect via from +24V_SWD to /+24V_SWD.

    In PCB Editor, the Search Panel shows that the +24V_SWD net has been inconsistently renamed/reconnected. Both "+24V_SWD" and "/+24V_SWD" exist.

Please find the example project file here: https://forum.kicad.info/t/eagle-import-incorrectly-inconsistently-changes-reconnects-net-names/69074

KiCad Version

Application: KiCad PCB Editor x64 on x64

Version: 10.0.2, release build

Libraries:
	wxWidgets 3.3.2 
	FreeType 2.13.3
	HarfBuzz 12.3.0
	FontConfig 2.17.1

Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW
OpenGL: Intel, Intel(R) HD Graphics 4600, 4.3.0 - Build 20.19.15.4835

	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: de_DE
	Enc: UTF-8
	Num: 1.234,5
	Encoded кΩ丈: D0BACEA9E4B888 (sys), D0BACEA9E4B888 (utf8)