Same issue here, makes watching tutorials as I code very difficult lol. The issue seems to be inconsistent and can sometimes be fixed with a restart. Any audio coming from any app is extremely distorted while Xcode is open; it starts when I run the preview or simulator in with SwiftUI.
MBP 2018 15"