Hi kev.
what car and engine is it?
I had an issue similar and it turned out to be the cam timing sensor on the pulley on an e36 petrol engine.
car wouldn’t see the sensor and wouldn’t start when it was hot, also lots of misfiring.
also, I cracked my thermostat housing which caused overheating and non starts and stalling.
I fixed it by getting a new car😞