If you replaced the O2 with a brand new O2 and the code still exists, did you clear the codes after the new O2 was installed?
If yes to new O2 and clearing codes, and the same code is still present on the same bank, there’s a breach in the wiring harness somewhere. Look for chewed, burned or damaged wire casing that is within any black conduit hiding the wires. Also check for any damage to the actual wiring harness connector.