USBasp stopped working after switching to Windows 11

Is this when you are using Arduino IDE, or the command line, or both?

I ask because I see you are using the -B flag in your command line to configure the bit clock period:

https://avrdudes.github.io/avrdude/8.0/avrdude_4.html#index-_002db-baudrate

This will affect the flashing duration. The "USBasp" programmer definition used by Arduino IDE when you have one of the "Arduino AVR Boards" platform's boards selected from Arduino IDE's Tools > Board menu doesn't configure a bit clock period, so it uses the default period set by the USBasp firmware (the unofficial variants of which have an auto-configuration capability).