You can NOT delete pending order when the market is closer to open price than MarketInfo(chart.symbol, MODE_STOPLEVEL)*Point
You can NOT close open orders when the market is closer to TP or SL than stop level
You can NOT set stops closer then stop level from the market
I Have the same problem with pending orders that cannot be deleted or modified.
I discovered that after restarting connection with server by for example changing server, the frizzed order became filled order and can be modified