The liquid doesn't start to expand and harden until it has left the gun nozzle into the atmosphere. The liquid in the gun tube should, in theory, happily remain liquid for a long time, just like the liquid that is still in the can.
Once you remove the empty can from the gun, the liquid in the...