Good afternoon, Levina!
It's possible only a portion of the card is bad, or the card is intermittent. Try your card and see that the problem recurs. Replace with another card and see if the problem seems to go away.
There are tools to check SD cards, but I don't know which are good ones.
Did you have a chance to check the time stamps on the images and see if some have an odd difference in time compared to the images that worked?
Also, the 7D2 (and other cameras) have a feature where images aren't taken if focus isn't locked. I wonder if this is turned on? If so, I wonder if the shutter isn't opened, but it still collects an image.
If you can share camera settings and configuration, others can try to reproduce the problem as suggested by @WilsonFlyer.
I looked at the time stamps and file names and see no anomalies.
As to not shooting if AF is not locked, as far as I know the R6, in Servo AF, will shoot, whether something is in focus or not. Besides, I have taken my number of out of focus shots with the R6!
As to my settings. I use back-button focus with Eye-AF on the AF-ON button and Spot-AF on the * button. Then I have the DOF Preview button set to Zone-AF, which acts as an assist. It works very well. Are there any other settings/configuration that might be of relevance?
That is estrange. I have had that happen as follows, but just one or two black frames every now and then when taking photos of the auroras at night: by unintentionally touching the screen before removing the lens cap. Black screens result from in-camera high ISO noise reduction, too. It does sound like a timing issue.
If your R6 is under warranty, take your time and see if you can duplicate the problem, then send it to Canon. They will probably need the card with the black frames.
Ray, I have both High ISO speed NR and Long exp. NR turned off. Also, I have not set up my camera in a way that touching the screen will take a photograph. And the black frames can happen at any time, like in the middle of shooting. So I have normal frames and then suddenly black frames and then normal frames again. Sometimes I get two or three black frames, two normal ones and again a few black ones.
The problem I have is that it happened twice in two days now. It also happened on 4 April, as I was shooting some swans. But before that I had several months of normalcy. I only wish I had kept all the black frames. Which I didn't, because I didn't think much of it. But now I am worried. And I just have no idea how to replicate it. So I will have to be vigilant and if it happens again make a note of what I was doing. And I will keep the black frames.
Silly question no doubt, but could it be some lens-to-camera connection maybe? Just wondering. Although that would also cause the EVF to go black, I suppose. Which is not happening. It's only when I take the camera down and see the last image being black on the rear screen that I realise the camera didn't record anything.
As to the "timing issue", what is that exactly?