Plants use carbon dioxide for photosynthesis and it only happens in the daytime because of the presence of Sunlight.
At night the photosynthesis does not happen because of the absence of sunlight but plants do respirate which takes the oxygen and releases Carbon dioxide.
As plants release carbon dioxide in respiration and that continues at the night and there is no oxygen given by plants at night, it is suggested not to sleep under the tree at night.
This may cause breathing issues or suffocation because of the presence of Carbon dioxide.