[virt-manager] Error connecting to graphical console

Hello,

I have spent a few days googling this error, but without success. I was installing these two libraries “libwxgtk3.0-gtk3-dev libfltk1.3-dev” on the day before the problem started. I removed them later. When I try to run the VM with Spice server, I get this error:

"Error connecting to graphical console: could not get a reference to type class"

I tried reinstalling virt-manager and all libvirt stuff, but to no avail. Please, does someone know what this error means? Thank you in advance for any suggestions.

EDIT: Also I should mention the VM runs in background and I can connect to it via VNC. I can use VNC, but it is less responsive and I cannot copy-paste into it, so it makes me want to pull my hair out.
Also since this problem started, I cannot connect my paired bluetooth hadphones to the system. Might be related to the problem.

My system is:

OS: Pop!_OS 22.04 LTS x86_64
Kernel: 5.17.5-76051705-generic
Shell: bash 5.1.16
DE: GNOME 42.1
WM: Mutter