This problem only seems to exist when orders are placed from the API. If I do it from the site manually, it works instantly, so, this has to be a problem with the API and not circuit limit issues, as all other types of orders go through except for modify_order(). The exact code works in any other time. I'm sure you should be able to reproduce it in your end too. Kindly look into this issue as it's extremely crucial.
This is the function that's used by us to modify all limit orders to market orders, for your reference. The error occurs even after 15 repeat attempts. The error message too is mentioned at the end of the code.