Running a KiCad script on MacOS

Could you post the full version string? Found via help->about->copy version info
(this info includes the compiler flags used for your build which should give us the information about what is going on.)


Additionally: did your run the script as standalone or using the python console from within pcb_new (or even as an action plugin)?