Check the signal at its source
The area P0331 identifies is the knock sensor circuit for sensor two, bank two, where the reading is outside the range that is plausible for current engine conditions, even though the circuit itself checks out. A confirming test still has to name the actual cause.
How to tell the paths apart: Read the live data and compare it against the expected range for current conditions before replacing anything.