Fixes https://gitlab.com/kicad/code/kicad/issues/12335
Also includes a change to the std::initializer_list stuff to try and fix a crash.