Hello FXDreema,
thank you for your message. I am working with MT5 netting mode.

I took your example and have the same problem. It opens 0.33 lots ...... tries to close 0.165 lots...... after opening additional 0.33 lots it can close 0.33 lots.
Best regards,
Martin