A script allows you to capture both the fact that execution failed (via an exception) and why it occurred, which is strictly more information than is available in a transaction group handshake.
I would not pursue transaction groups for this purpose.
Try adding catch blocks that explicitly capture both Java and Python exceptions: