The solid sodium hydroxide reacts with both CO2 [gas] and H20 [Liquid] while being weighed .

Q1 Where did the Carbon .dioxide and water come from

3 answers

The CO2 and H2O come from air.
H2O as moisture in the air and CO2 a gas that found in air that released from human being.......
I agree with your answer but in fact the H2O in the air may well be vapor (gas), not liquid.
and probably is vapor.