In my mind, the cool airplane has smaller parts, and therefore larger gaps in the joints.
Sort of .... the aircraft expanded when at Mach 2, so it grew in length etc. This growth translated itself into the gap that the hat was put in. When it cooled on decel/descent, the gap closed wedging in the hat.
Simples...