I just experienced yesterday, using zoom, even though the HDMI output speakers were chosen in System Pref, the built-in speakers were chosen in zoom.
Zoom has its own preferences panel that lets you choose input and output devices independently of the system settings.
Perfect, thanks for the tip.
If it works, it works, but it should be unnecessary - plugging in headphones should turn off the internal speakers, so something odd seems to be going on.
As for the System->Preferences->Sound->Output "Select a device for sound output", on my Studio, as well as offering the various USB and DisplayPort devices I have connected, it normally just offers "Mac Studio Speakers"
until I plug in headphones, and then an extra "External Headphones" option appears & is automatically selected in preference to "Mac Studio Speakers" you can switch between them.