Of course you need to replace the cam position sensor. The ECU rely on the data from the position sensor and adjust the timing with the engine speed and temperature. If the engine is not getting the right data. It may shutdown the engine or provide the wrong timing to plugs and injectors.