(cherry picked from commit 610e787ada) Fixes https://gitlab.com/kicad/code/kicad/issues/14414
610e787ada