Rtde-control reconnect after emergency stop

Hello, I am currently working with the rtde library on a Linux Ubuntu 20.04 system and developing using VS Code. Due to the lack of some teach pendants, we have created a few functional interfaces for the teach pendants. I am currently encountering the following issue.
After an emergency stop of the robot arm, I use rtde-control->disconnect() to disconnect. This ensures that my interface does not crash. However, I am having problems when using rtde-control->reconnect() to reconnect. My first attempt to reconnect always fails, and it is only on the second attempt that I can use the functions of rtde-control.
I would like to inquire if there is any other method to solve this reconnection issue after disconnection, as it consistently causes my interface to crash. Additionally, I am also unable to successfully call setpayload within rtde-dashboard when operating in remote mode.

ps: Other functions such as moveJ and moveL are working normally.