Plants still perform respiration using oxygen. Photosynthesis lets them create their own sugars, but their process for using those sugars in the mitochondria is similar to how we do it. Plants release more oxygen than they consume because they grow: in order to grow they must pull CO2 from the air, use the C as building material (instead of respiration fuel), and dump the O2.
A plant’s metabolism still needs to function even when the sun isn’t shining.
So they consume oxygen at night, in their roots, etc. This is most apparent for the occasional parasitic plant without chlorophyll. https://en.wikipedia.org/wiki/Albino_redwood