The student is partly correct. Oxygen is produced in the leaf by photosynthesis. In bright light, photosynthesis produces oxygen faster than the leaf's cells use it, so the extra oxygen is a waste product of metabolism and diffuses out of the leaf through the stomata. In the light, the carbon dioxide made by the leaf's respiration is used in photosynthesis, so it is not a waste product then.
However, plant cells respire all the time, day and night, and aerobic respiration uses oxygen. Even in the light, the roots and other parts of the plant without chloroplasts cannot photosynthesise, so they must take in oxygen for respiration. In the dark there is no photosynthesis, so no oxygen is produced; the leaf must take in oxygen through its stomata for respiration. At the same time, carbon dioxide made by respiration is not used in photosynthesis, so carbon dioxide becomes the waste product and is lost through the stomata.
So oxygen is a waste product only when photosynthesis is faster than respiration. The student is wrong to say a plant never needs to take in oxygen.