If someone encounters a similar situation, you can change the executor type from threadpool to processpool, which should resolve the issue. However, the exact reason is still unclear.