OrderSelect returns the wrong order

 

Good afternoon,

In my EA I store an array of tickets I get using OrderSend.

Later in the code I try to access the order with OrderSelect and the following code :

if (OrderSelect(ids.At(i), SELECT_BY_TICKET)) {
        if (OrderMagicNumber() == OrderMagic) {
		// Do something here
        }
}

In most cases this appears to work but somehow at some point during the execution I receive another order with completely different values that the one that are expected (price, symbol, TP and SL are different).

I can't understand why this happens so I was wondering if there is some kind of logical explanation behind this.

Reason: