Thanks for your helpful suggestions.
The camera is about seven years old and has never been dropped. I have used it in all kinds of adverse conditions. That is what it is designed for, and I have never before had a problem. I once dropped my other EOS 1D series camera (1D ii N), four feet onto concret and it has continued to work perfectly and suffered only a couple of tiny scratches. This new problem occurred on a warm, dry day with what I thought was a fully charged battery.
I tried leaving the battery overnight, and got two shots before the problem recurred. I also cleaned the terminals inside the camera.
The problem turned out to be a faulty battery. What threw me was the coincidence that the second battery had the same issue. Insufficient power to complete the shot, with lens attached, even though it was showing fully charged before pressing the shutter.
I had the brainwave of trying the camera with the Mains adapter. It worked perfectly. I then tried with the failing batteries. Problem recurred. THen with the nearly new battery from the iD ii N. Works perfectly!