PCB: Creepage DRC calculates path between incorrect objects

This is follow-up to #20480 (closed), but I believe the cause is different, so I'm opening a new report.

I'm attaching a test project where I increased creepage distances between component pads with two rectuangular slots in Edge.Cuts. Screenshot below actually displays two bugs:

  1. Creepage calculation ignores one rectangle edge.
  2. The bottom end of creepage path ends at pad's hole, not its copper edge.

Both these bugs appeared only after I added a second Edge.Cuts rectangle between pads of an AC/DC converter that's not pictured in the screenshot.

Test project creepage.zip

New crewpage bugs 1.png

KiCad Version

Application: KiCad x64 on x64

Version: 10.0.0-rc2-45-gc62b9aad23, 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: ATI Technologies Inc., AMD Radeon RX 7900 XT, 4.6.0 Compatibility Profile Context 25.6.1.250522

	wxWidgets: 3.3.2 (wchar_t,STL containers)
	Boost: 1.90.0
	OCC: 7.9.2
	Curl: 8.18.0
	ngspice: 45.2
	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)