Fixes https://gitlab.com/kicad/code/kicad/-/issues/14250 (cherry picked from commit 43c3cd57eb)
43c3cd57eb