"Simulating this with backtrader appears to result in errors."
backtrader is only doing what you are telling it to do. That isn't an error.
In order notification, if buy order is executed I execute two sell orders: one limit order with stop loss, and one stop order with take profit. This eventually fails and results in strategy executing both of the sell orders. Ideally if one of these sell orders is executed, i would like the other one to be instantly killed.
It doesn't fail. It simply doesn't fulfill your own expectations (it is nowhere stated in the documentation that one order will be cancelled because the other is executed)
You are looking for
OCO (Order Cancels Order) functionality and this is not implemented in backtrader
How should I code takeprofit/stoploss on my positions?
In the absence of
OCO, a dictionary can do the trick, by adding two entries. In one the stop-loss order is the key and the take-profit order is the value. In the second entry the roles are reversed.
Upon being notified of the execution of one order, inspection of the dictionary allows cancelling the pending order
Should I extend the bbroker itself to support stoploss/takeprofit?
The platform is open.