I recently got a new Mac (running Monterrey 12.4, M2 chip). I never had this problem before, but now each time I plug in or unplug headphones, I have to manually change the output device, from speakers to headphones and back again.
Audacity is actually not the only program I have this problem with (though it’s not every program either), but I was told that having output independent of the system setting was an intentional feature here, which makes me hopeful that there might be a built-in way to override it. Is there?
What a PIA! Several years ago, a Windows update did that to my computer, so I feel for you. Fortunately I was able to download a different driver that contained a solution for me. Since then, the new updates have replaced that driver, but happily it works the way you would expect it to.
This is a good question for Apple. What do they say?