Fixes https://gitlab.com/kicad/code/kicad/-/issues/17085 (cherry picked from commit 8dddd9cc2c)
8dddd9cc2c
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12413