Error opening sound device when attempting to play audio with earplugs in

Audacity version: 3.1.3
OS: macOS 11.6
Issue:
Whenever I play audio with earplugs in, an error message pops up saying “Error opening sound device. Try changing the audio host, playback device and the project sample rate.” I have followed all the troubleshooting steps in https://manual.audacityteam.org/man/error_opening_sound_device.html, unfortunately none of them have worked.

Within the “Problem details” that show up along with the error message I notice these lines of code, which may or may not be helpful:
“mechanism”: {
“type”: “runtime_error”,
“handled”: false
}


It is interesting to note that this does not happen when the output device is set to the MacBook speakers, and audio plays as expected, even when the input device is still the external microphone.

You can try Transport > Rescan Audio Devices

Are these bluetooth earbuds? Audacity does not play well with bluetooth audio devices.
– Bill