Sorry, i should have been clearer in my explanation!
The gas that enters and pressurises the 1st stage indeed intially cools down as it enters, but then as it gets pushed back up to pressure by the gas continuing to flow in, it warms back up again. Yes, heat is lost and it's final temperature is slightly less than it was in the tank (which reflects the word done on that gas)
The gas that "matters" is the gas that is already at ambient temperature and pressure sitting in the 1st stage, that gets shunted along and pressurised by the gas entering that stage from the cylinder. This gas starts at ambient temp, so as it gets compressed it heats up signficantly if it doesn't have enough time to reject that heat to the walls of the 1st stage containing it!