For finding the reason of the bug, print your variables and the open trades after restarting. If you cannot find the bug, you can contact support and let them fix your script. As usual, if it is not a bug in your script, but a Zorro bug, the fix is free.
But you can easily test if it is really a Zorro bug by writing a simple 3-line script that just opens and closes positions.