I’ve tried the demo project on two systems (16-inch macbook running Catalina, and a 15-inch macbook running Big Sur). In both cases, I opened the plugin in Logic 10.6.1, ensured the editor was visible, and then plugged/unplugged an external display a few times. I didn’t encounter any crashes. Perhaps the issue is only triggered by very specific hardware combinations.
Could you check whether the issue is also present when hosting in the AudioPluginHost? If it is, I’d recommend building both the AudioPluginHost and the DisplayTest plugin with Address Sanitizer enabled, and then triggering a crash. The full Address Sanitizer output should provide sufficient detail for me to identify the problem.