For advanced users who are trying to tix weird problems
Ensure that the camera is enabled and there is enough GPU memory:
Add the following lines to the /boot/firmware/config.txt
file:
And then reboot. Note that the config.txt file will say that you should not modify it and instead make the changes in a file called userconfig.txt. However I found that the userconfig.txt file is not invoked. So I added the lines above directly to config.txt.
Check the amount of gpu_memory
It should show 256 or whatever number you put there.