Fixes https://gitlab.com/kicad/code/kicad/-/issues/15280 (cherry picked from commit 1cbef0157d)
1cbef0157d