I don't use headphones/microphone on discord, so far and am unlikely to start. With the windows discord app, when I change audio devices, discord prompts me to ask if I want to change audio devices. How can I get it to stop doing this? I've set input and output audio devices to default.
I speculate that this is a problem with HDMI and your screen being locked/unlocked. It happens to me regularly with my multi-monitor, multi-videocard setup.
Even if you don't have audio built into your monitor, Windows often assumes you do. My machine also will occasionally switch to the non-existent HDMI audio out, in discord or elsewhere. And then I can't hear anyone until I manually switch back to the actual audio input.
So what is probably happening is that your monitor goes into power-saving mode, then when you become active again it detects the HDMI turning on as a "new audio device" (even if it doesn't support audio) and pops up that alert.
The same can happen with other display types that support audio, like DisplayPort.