Which version of Lumerical are you using? Are you running lumapi from the CAD's script file editor window? Is this happening to all Python API script? Or the issue only happens to a specific command and only when you force quit the script?
Please try to run the script below from the CAD.
import lumapi
fdtd = lumapi.FDTD()
fdtd.addfdtd()
fdtd.addring()
fdtd.addmesh()
fdtd.save("mytestpy.fsp")
Would you be able to share a sample script that is causing this issue? Copy and paste the sample script. Thank you.