Why was a pending order executed by the price different from the one I had specified?

Stop Orders (Buy Stop, Sell Stop, Stop Loss) are executed at the market price that the liquidity supplier has at the moment of the order execution when the asset price reaches the level specified in the order. Such orders are not guaranteed to be executed at the specified price as the latter is just the triggers for order execution.

Limit orders (Buy Limit, Sell Limit and Take Profit) are executed at the specified or the most profitable price (depending on the current market situation).