Assert and ghost footprint after dragging a footprint, then undoing.
# Board
[test1_8.kicad_pcb](/uploads/206909d54d8a290279e68144712797da/test1_8.kicad_pcb)
# Video

# Steps to reproduce
1. Press D and drag the footprint
2. Click
3. Ctrl-Z to undo
4. Get an assert
5. See a "ghost" footprint appear also
# KiCad Version
```
Application: KiCad PCB Editor x64 on x64
Version: 8.0.0-56-g339646a267, debug build
Libraries:
wxWidgets 3.2.4
FreeType 2.12.1
HarfBuzz 8.3.0
FontConfig 2.14.2
Platform: Windows 11 (build 22621), 64-bit edition, 64 bit, Little endian, wxMSW
wxWidgets: 3.2.4 (wchar_t,wx containers)
Boost: 1.83.0
OCC: 7.7.1
Curl: 8.5.0-DEV
ngspice: 42
Compiler: Visual C++ 1937 without C++ ABI
Build settings:
KICAD_STDLIB_DEBUG=OFF
KICAD_STDLIB_LIGHT_DEBUG=OFF
KICAD_SANITIZE_ADDRESS=OFF
KICAD_SANITIZE_THREADS=OFF
```
issue