I have seen the same but on most occasions found it was to do with the cable connections to the camera facing or not to the connections. Check a single camera cable on another Pi; if it works check combination of cables to give required lengths with one or other of the available cable connectors.
I also faced the same problem. My camera was enabled but while running script it was asking me to enable the camera. Then I found out that it is because of loose camera connections. There are three connection points as shown in figure 1 and figure 2. Mine was loose at the point shown in figure 2.
So, to solve your problem please check ...
I had the same problem. My Pi Zero W worked fine for 10 hours or so and then various kernel panic messages. The errors would get more frequent and at a point I could no longer connect to the Pi.
It looks like the Pi is under-volted for this job.
After some investigation I solved this by adding the following lines to the file /boot/config.txt