You should give more detailed information about your KiCad version (About->Copy Version Info) and the underlying system.
Not that it would help much - the message is so generic that it’s difficult to say where it comes from. My guess is the export function which uses a 3rd party library to do its job.
If exporting from KiCad doesn’t work you can install FreeCAD and kicadStepUp workbench and open the board from FreeCAD, then export from there to any supported format.
Thanks. I use FreeCAD-pcb to open the file. It still has problems. I redraw the board outline again and this time I can export the step file with no problem. I would expect if 3D View is fine, export will be fine too. Probably, like you said, Kicad uses a 3rd party library to do this job.