Fixes https://gitlab.com/kicad/code/kicad/-/issues/14777 (cherry picked from commit 14f004d2a5)
14f004d2a5