Crash when importing schematic settings from other project

Description

Kicad 7.0.7 waits some time and then closes abruptly when trying to import schematic settings from another project.

Steps to reproduce

  1. Create a new project, click schematic editor
  2. Click "Edit schematic setup" icon
  3. Click "Import settings from another project" button
  4. Click all checkboxes
  5. Select a same kicad version project
  6. Click Ok

KiCad Version

Application: KiCad x64 on x64

Version: 7.0.7, release build

Libraries:
	wxWidgets 3.2.2
	FreeType 2.12.1
	HarfBuzz 6.0.0
	FontConfig 2.14.1
	libcurl/7.88.1-DEV Schannel zlib/1.2.13

Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
	Date: Aug 14 2023 02:42:39
	wxWidgets: 3.2.2 (wchar_t,wx containers)
	Boost: 1.81.0
	OCC: 7.7.1
	Curl: 7.88.1-DEV
	ngspice: 40
	Compiler: Visual C++ 1936 without C++ ABI

Build settings:
	KICAD_SPICE=ON