It looks like the RuntimeError is in the C backend. You can run that through gdb with something like the following:
gdb python
> catch throw
> run test.py

Where test.py 3 is your python script that’s raising the RuntimeError
gdb will pause when the RuntimeError is thrown and then you can type backtrace to get a backtrace.