When you see the immediate debit, the retailer has not actually received the money. That will not be done until they submit their transactions when they are batched up, usually at close of business.
So when a credit is due, the Bank do not know it is coming and cannot credit you until it is actually received. Depending on when the Company completes the process in reverse. So they might not receive the original payment for a couple of days and the bank will not receive the refund for a coupe of days.