Why does OCR action fail with exception and doesn't recover?

Hello everyone,

I am running a macro that loops through several steps to OCR an area to gather data and save it to a sqlite3 database.
The macro runs for like an hour or so without issues and then stops with the exception:

2020-03-23 20:14:25 Launch Task /Applications/Keyboard Maestro.app/Contents/MacOS/Keyboard Maestro Engine.app/Contents/MacOS/Tesseract /Users/Marcel/Library/Application Support/Keyboard Maestro/Tesseract Trained Data/Languages eng /var/folders/3h/sp25vk3d3t15wzdqtqdz7vkc0000gn/T/OCRImage-1C573362-5E34-4C88-AEAC-F266EC5770DB.tiff failed with exception Failed to set posix_spawn_file_actions for fd -1 at index 0 with errno 9

Now even if I run the bash script(filling the database) in a separate macro e.g. call it async and let it fail for this case, it always fails afterwards. Once it fails it continues to fail again and again.

Edit1: The OCR seems to have issues, but it seemed to fail at the bash script as well:

2020-03-23 20:14:25 Launch Task /bin/sh -c /usr/bin/osascript '/var/folders/3h/sp25vk3d3t15wzdqtqdz7vkc0000gn/T/Keyboard-Maestro-Script-32F1EA67-6C06-4C2A-9DD7-D13948C6071D' failed with exception Failed to set posix_spawn_file_actions for fd -1 at index 0 with errno 9

2020-03-23 20:14:29 Task failed with status -1 Macro “Calculate average price” cancelled (while executing Execute Shell Script).
2020-03-23 20:14:32 Execute macro “[Logging] Write To Log File” from trigger Execute Macro
2020-03-23 20:14:32 Launch Task /Applications/Keyboard Maestro.app/Contents/MacOS/Keyboard Maestro Engine.app/Contents/MacOS/Tesseract /Users/Marcel/Library/Application Support/Keyboard Maestro/Tesseract Trained Data/Languages eng /var/folders/3h/sp25vk3d3t15wzdqtqdz7vkc0000gn/T/OCRImage-8D4C23BF-23D8-449F-97AB-7661945B38F5.tiff failed with exception Failed to set posix_spawn_file_actions for fd -1 at index 0 with errno 9

End Edit1

Edit2:

Whenever the macro fails, I can just rerun the shell script on my own and it works. Also printing it via adding the show text action shows no issue. Last but not least, starting the macro just continues without issues for like an hour. It just magically stops working and I don't understand why :confused:

End Edit2

Shell script looks like:

#!/bin/sh
sqlite3 /Users/marcel/Documents/Work/i3tex/sqlite/Stuff.db <<EOF
INSERT INTO Items ("Var1", "Var2", "Var3", "Var4","Var5") VALUES $KMVAR_FillValue;
EOF

Cheers,

FroZen