Measure the voltage between camshaft position sensor connector and engine ground.
Connector & terminal
(E36) No. 2 (+) — Engine ground (−):
Is the voltage 5 V or more?
Repair the short circuit of harness to power supply between ECM and camshaft position sensor.