An order goes through various phases in the broker’s OMS (order management system). Some of these phases (like validation) do not allow an order to be modified. In such case, you will see above error.
Solution
Wait for some time to allow broker’s OMS system to complete it’s processing, then send modification request.