Fixes https://gitlab.com/kicad/code/kicad/issues/11788 (cherry picked from commit f22cf1cc3a)
f22cf1cc3a