reset also works by triggering suspend / resume
Today I accidentally found this command to be adequate to reset the GPU. I've used this reset script and found it works reliably.
This for the RadeonVII, I had not replaced the XX with the PCI bus ID. The VM was still running and had failed to capture the GPU. Running the script suspended the machine, then resumed after pressing the power button. On resume the GPU was captured correclty.
#!/bin/bash
#
#replace xx\:xx.x with the number of your gpu and sound counterpart
#
#
echo "disconnecting amd graphics"
echo "1" | tee -a /sys/bus/pci/devices/0000\:XX\:00.0/remove
echo "disconnecting amd sound counterpart"
echo "1" | tee -a /sys/bus/pci/devices/0000\:XX\:00.1/remove
echo "entered suspended state press power button to continue"
echo -n mem > /sys/power/state
echo "reconnecting amd gpu and sound counterpart"
echo "1" | tee -a /sys/bus/pci/rescan
echo "AMD graphics card sucessfully reset"
This does not work for me at all (Ryzen 5 5600G / Cezanne / Vega 7 / CHIP_RENOIR). I also cannot imagine that it would work like this for other people.
However, possibly you still had the vendor-reset udev rule active, which disables the default reset even if vendor-reset module is not loaded, like this:
echo "device_specific" > /sys/bus/pci/devices/0000:XX:00.0/reset_method
With this command and without vendor-reset module, the chip never resets in Linux in the first place (the default Linux reset renders the card entirely inoperable). And presumably then it resets via hardwired subroutine if you suspend and wake your PC. So this could possibly explain how it worked.
I have personally made different experiences in how Qemu behaves than people have reported online in the past, and this might be due to newer Qemu version or what not. First in order to add the card in Qemu to the VM, it needs to be already initialized in some form and present in /sys/bus/pci/devices. Then when Qemu starts, it resets the card again to add it to the VM. So it never worked for me even just once, without vendor-reset, because the default reset would mess up the cards internal state and cause the VM to borderline crash. So you see that in my case your method would not be helpful in the same way, even if it was possible to make it appear in Linux PCIe tree again once removed & improperly reset.