I had to make some tweaks to the code to compile into the nano every.Check wiring connections, I had it happen once on mine, was just a loose wire that needed to be connected better.
Code works fine if you copy pasted the code in. If you made any edits to the code that could mess it up if you edited it without knowing what was being edited.
Again, not an issue with the code that you posted, had to tweak it.With all due respect, this isn't a coding error... my guess is that several hundred cars are using this code without issue. If the LED on the Arduino is turning on and off when the key is on, then the board is working properly, too. I'd go ahead and check your connections one more time.
You probably need to get an oscilloscope so you can 'see' the signals on each wire.
The problem comes and goes and that also makes me think its more wiring than anything else, unless I have a bad board that does not always function as designed.
Today I resoldered all the connections and tidied up the actual wiring a bit. We will see on the way home!