We have gone through your order logs and found out few things. This is a rare phenomenon and can happen with anyone. There is little control of broker in this. Here is the explanation:
Let us first understand the execution of Basket Order. The basket order is placed in the same sequence as arranged in the basket. You will get the hedge benefit upfront (or the overall margin will be same as shown in basket) only when the sequence of execution of orders is followed. There may be a case when your first order (say Buy market order for options) is placed first but didn’t execute or executed lately for some reason. And then second order ( say Sell market order for options) is placed. Since the Buy order is not executed, so your Sell order may reject if there is insufficient funds. The reason for non-execution or delayed execution of Buy market order can be anything : Low liquidity or MPP on options so market order is converted to limit order or delayed response from exchange etc…
Next let us understand the concept of “Hedge Break Alert”. In the above case, if all orders are successfully executed, you will get upfront hedge benefit, hence lower margin requirement to execute option strategy. Point to note, the Sell leg (short position) is hedged by the Buy leg (long position). The standalone short position has higher margin requirement than with a hedge. So if you try to exit long position first, then you must maintain sufficient margin to sustain standalone short position or exit the short position first. If this is not followed, our system will alert you about the Hedge Break and will not let you exit the strategy to avoid any margin shortfall.
Now in your case, you are doing it correct with basket order. Exiting the short open position first (with Buy order of 18050 PE) and then long open position (with Sell order of 18600 PE). But for some reason (it may be any as mentioned above but non exhaustive) your Buy order of 18050 PE is not executed before the Sell order of 18600 PE is placed, hence you got a hedge break alert message. All this happened in fraction of second. Though after few millisecond the Buy order of 18050PE is successfully executed as it was placed earlier. Later when you manually exited 18600 PE it went successfully.
Trust me, all this happened in fraction of seconds.
This is very rare, and cant be controlled. The only suggestion from my side will be to avoid trading in illiquid contracts or try placing order manually. Even if you are automating your system, make a rule to place next order only when you have a confirmation of successful execution of first.
Hope this helps!