Here is my theory: The 2 troopers go in the Falcon at Han's request. After Han and Luke knock them out, they take their armor and put in on in a hurry. It is at that point that Luke's takes the hero lid.
To me, another continuity issue is where did they hid their "rebel clothes"? After putting on the armor in the Falcon, they change back to their rebel clothes before returning in the Falcon. I'm sure the rebel boots didn't fit in the TK boots