OK, the crash should be fixed in https://github.com/RetroPie/RetroPie-Setup/pull/3861.
It doesn't matter how many un-configured devices are detected, one is enough to trigger the bug whenever its input is procesed by joy2key (a button needs to be pressed to trigger the bug).