The company’s record profit a year earlier was driven by a surge in oil prices after Russia’s invasion of Ukraine.