I was driving when the battery light came on and engine cut out. I coasted to the side of the road and tried starting the engine, it turned over but didn't fire up.

The engine turned over quickly, the battery is in good condition.

I tried starting it again after about an hour and the engine went from turning over, to signs of firing, to actually firing and running.

I drove it home (a few minutes drive and it ran perfectly fine).

I have started it a few mornings since and it has started immediately.

I ran VCDS and got the following error code:

012295 - Camshaft Position Sensor (G40)
P3007 - 000 - No Signal - Intermittent
Freeze Frame:
Fault Status: 00110000
Fault Priority: 3
Fault Frequency: 47
Mileage: 199021 km
Time Indication: 0
Date: 2000.00.00
Time: 08:44:08

Freeze Frame:
RPM: 1197 /min
Speed: 43.0 km/h
Load: 20.0 %

From what I've read it could be crank sensor, fuel pump or crank sensor?

Anyone have any ideas?

Thanks!