When using --console=gui the QEMU window closes immediately when the VM has stopped, so any console output at shutdown is lost, which makes debugging difficult. Ensure the VM stays booted for a minimum of 15s.