In September this year, I often experienced that MacOS 12.6.9 lost all audio devices. That is, MacOS did not find any sound devices in the system preferences and also in the volume control. The only solution was a reboot.
After updating to 12.7, this phenomenon is resolved, but often all software that uses audio devices freezes. The only solution is to restart the operating system.
It is unstable and I cannot concentrate on my work.
My main computer is a MacBook Pro 2021 (M1 max). I mostly use the Macbook speakers and external headphones on this computer, and occasionally the MOTU UltraLite. I attach an image file showing all my audio devices.
You need to check whether each of those has drivers installed; and whether they are up to date; and see whether the problem goes away if you remove those devices.