This appears to be a bug, but I cannot confirm whether it's Graphene OS or Android 14 specific. It is triggered by starting an audio playback and plugging the DAC in. It does mute the playback on the speaker but DAC output will start to output loud noises. If you pause the playback, plug the DAC in and start playback, it may play normally. I initially observed this behavior on WhatsApp and there no amount of plugging in and out could fix the problem. I suspect it's because WhatsApp while running may activate audio output chain even though there are no calls or notifications coming at the moment.
Can anyone confirm the behavior on Graphene OS and stock Android 14?