This is an open source project and not really supported here on the forums, but you will likely need to play with the timing or increments of the PTZ instructions being sent to the camera. I have seen cameras act in the manner you describe when they are overwhelmed with too many instructions. It’s also possible if the camera is too busy, it missing or not getting the STOP instructions.