Every broker has a limit on how many times a single order can be modified. For example, one of the leading broker in India does not allow you to modify an order more than 20 times. This limit changes from one broker to another. So please ask your specific broker for details.
Solution
Make sure your code does not send modify request for the same order beyond the limit set by your stock broker. You must cancel that order and place a fresh order in such cases.
If this is not the case and you are within limits, then please report it to support team.