I can easily reproduce this crash when I call AVAudioSession.sharedInstance().setPreferredInput(...) over a wired headset mic.
By calling setPreferredInput over a wired microphone, my AVAudioSession.routeChangeNotification do not notificate when I unplug a wired headset while this headset is both the preferredInput and the active input, as seen in session.currentRoute.inputs.first.
All the notification handlers (OS Media Reset, OS Media Lost, Interruption, etc) do not fire when I unplug a headset in the condition above.
To protect my audio graph, I stop the audio engine and reroute it when I set the headset mic as the preferred input, in a attempt to not be in the mercy of route change notifications in this particular case.
Finally, node.play() crashes when called.
The crash above happens when my engine is active, since I must activate a engine before playing any player node.