PCB: Select grouped items and ungrouped via "shift" crashes Property Inspector

Description

In pcb editor when you add grouped items to ungrouped via shift, Kicad crashed with core dump

Steps to reproduce

  1. Add rectangular to silkscreen
  2. Add two circles to silkscreen
  3. Group circles
  4. Select rectangular (order is important)
  5. Select circles group (with shift)
  6. Kicad crached

Project with sample included group_bug.zip

Logs:

$ GTK_IM_MODULE=ibus kicad                                
terminate called after throwing an instance of 'std::runtime_error'
  what():  Could not cast INSPECTABLE to the requested type
[1]    11878 abort (core dumped)  GTK_IM_MODULE=ibus kicad

KiCad Version

Application: KiCad x86_64 on x86_64

Version: 7.0.1-3b83917a11~172~ubuntu20.04.1, release build

Libraries:
	wxWidgets 3.2.1
	FreeType 2.10.1
	HarfBuzz 6.0.0
	FontConfig 2.13.1
	libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3

Platform: Ubuntu 20.04.5 LTS, 64 bit, Little endian, wxGTK, ubuntu, x11

Build Info:
	Date: Mar 15 2023 03:29:26
	wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
	Boost: 1.71.0
	OCC: 7.5.2
	Curl: 7.87.0
	ngspice: 38
	Compiler: GCC 9.4.0 with C++ ABI 1013

Build settings:
	KICAD_SPICE=ON