Fixes https://gitlab.com/kicad/code/kicad/-/issues/13105 (cherry picked from commit 8b24496b79)
8b24496b79