There's a paper that suggests that de-oxygenation might happen in around a billion years, so before the sun swallows the earth: https://www.nature.com/articles/s41561-021-00693-5