Your script might reference configuration files, images, or models. PyInstaller doesn’t automatically include these. Use the --add-data flag:
To find out exactly why it failed, you need to see the "Traceback" (the detailed error log) that is currently hidden behind that pop-up.