If you are trying to record what is playing on your computer, then you must record from the “loopback” option of the device that is playing the audio. So if you are playing through USB headphones, then you need to set Audacity to record from the headphones loopback.
I get the following message whenever I set up the headphone rate in the Windows Sound Properties after opening Audacity:
Error opening recording device.
Error code: -9996 Invalid device.
On the other hand, I can use WASAPI recording of the headphones if I set up the headphone rate in the Windows Sound Properties before opening Audacity.
HTH
Robert