cad/kicad: fix failure in certain modes (e.g. exports)
The use of dynamic_case here results in failures (error exits)
and seems to be actually wrong, which is exposed by our clang
(mabe gcc handles this just fine?
PR: 270273
Reported By: Pero Orsolic