1999 Mitsubishi Galant ES

On the SOHC 2.4L engine I got a PO340 code so I replaced the Camshaft Sensor and I still get the PO340 code .
The car will drive ok until you step on the gas hard, then the engine dies for 4 or 5 seconds and then it accelerates. I’m told that it could be the “CRANKSHAFT sensor effecting it to throw the PO340 code. True or NOT?