Social interations, can be very wierd.
The same thing can happen, for multiple diferent reasons.
One time, I was standing In line at greggs and The guy in front said he would get me suasuage rolls for me. But the lady suddenly looked offended, saying, She's more then caperble of buying her own suasage rolls.
But situations, very similer to this keep poping up,
But have extream differences.
The offer to pay has been done in charity, the change the person in front would of recieved was equal to what I was getting, and it was akin to keep the change.
The offer to pay has been made as a percieved favour to the cashier, the person in front was transphobic and assumed it would be a favour to save the chashier from having to deal with me.
And The offer to pay has been made as a flirt, easey to tell with the wording, And Ill get what ever this young lady wants too, with a big smile passed back to me, and offering me to stand with them at the counter. Ofcourse, I say, arnt you supposed to offer to buy me lunch after you find out if im single or not

.
But I think that if you spend time trying to guess why sombody does somthing, you wont get any closer no matter how educated your guess. Its best just to accept and/or decline as you wish, and let the answers come to you, if any. And not spend tie looking for them :p
Live life, dont question it