I am trying to understand why the order of elements in the scriptSig of the HTLC success transaction is the following(remotePub|localPub|preimage):

although the HTLC output locking script expects the order remotePub|preimage|localPub:

What am I missing?