Saying net production of oxygen is zero is not identical to saying net sequestration of carbon dioxide is zero.
Photosynthesis: 6CO2 + 6H2O → C6H12O6 + 6O2
You can see here that there's glucose (a carbohydrate) being produced in addition to oxygen.
EDIT: You might find this PBS article interesting as well, https://www.pbs.org/newshour/science/no-the-amazon-fires-won...
"Forest plants produce lots of oxygen, and forest microbes consume a lot of oxygen. As a result, net production of oxygen by forests – and indeed, all land plants – is very close to zero."