To reproduce the bug: Execute python run_bug.py. The second flow will throw. Execute python run_no_bug.py. The second flow will succeed.