Recording with windows WASAPI gives invalid sample rate error ONLY when recording a second time

Info:
Audacity 2.3.3
Windows 10 Pro 1909
I have a very strange issue that has plagued me for about 2 years now through multiple audacity versions:
Whatever recording device I select and use with WASAPI, I can record perfectly fine. But as soon as I try to record again, I get an error opening the recording device:
error.PNG
What’s weird is that if I switch to something like MME, record, then go back to WASAPI, I can record once more. But if I record a second time with WASAPI, it gives the same error. I use WASAPI normally because it gives me the least glitches during audio recording. Even more strange is that if I record my microphone, it sometimes doesn’t give the error and records fine a second time, but the issue is amplified when I use my audio interface. No matter what, I cannot do a second recording with WASAPI unless I switch to MME and back. Does anyone know why this is or how to solve this?

On the same track or a new track, or does that make no difference?

It makes no difference.

I’m having this same problem, except i only get it when recording a new track rather than the same one

Check in the Windows Sound control panel to see what the “sample rate” is for the audio device that you are using, in both the Record tab and the Playback tab. They should both match the Audacity “Project Rate” (lower left corner of the main Audacity window).

The sample rate is exactly the same

What are they set at?

If I’m recording with my microphone, they’re both set at 48khz, if I’m recording with my interface, they’re both at 96khz. That’s whats strange, they’re both the right sample rate.

Try setting the “Project Rate” (lower left corner of the main Audacity window) to match the sample rate of the device that you are using.