I was not running the latest build, so I changed to the latest image. Unfortunately I was still getting the same error.
In desperation, I tried a different PI zero and it worked fine.
I’m must have had a badly soldered GPIO strip.
Thanks for you help.