I've been using the screen share app to connect to my M1 mac mini to my M1 Pro MBP using Ventura with no issues. I recently installed the latest release of Sonoma on both machines and am now experiencing this crazy sound every time I connect to my mini from the MBP. The Mini also tells me that "My computer is being remotely controlled" over and over again in a very distorted voice and blocks using the mouse so I have to force quit the screen sharing app to exit.
I installed RealVNC and can use it without issue, which tells me it's the Screen Sharing app and not remote connections. However, RealVNC is much slower than the screen sharing app, to the point of being useless. I'm on a wired network as well and it's still pretty clunky. Running screen sharing on Ventura was pretty flawless.
See video below. Turn on the sound
https://imgur.com/a/406jiOY