Check the signal at its source
What P0321 actually reports is a condition of the crankshaft position sensor: the reading is outside the range that is plausible for current engine conditions, even though the circuit itself checks out. Treat that as a starting point for investigation, not a verdict.
How to tell the paths apart: Read the live data and compare it against the expected range for current conditions before replacing anything.