Captions are take from several sources:
1. If enabled in the backend options (Get the image captions from the database): from the “Caption” field in the media library
2. If provided by the gallery frontend one of the following elements in the HTML code. Whatever provides the caption first will be used:
The text element referred by the aria-describedby
attribute in the image link.
The first figcaption
element inside the image link element.
Any following element after the image link element if it has the class wp-caption-text
or gallery-caption
or if it is a figcaption
element.
The title
attribute of the image link.
(Yes, finding the image caption is not easy in the frontend ;-)).
So the most reliable way should be to add the caption to the “Caption” field in the media library and enable the option “Get the image captions from the database”. If this slows down the website too much for you (usually this is only a problem on really slow servers), you can also disable that and let the frontend script try to figure out the caption. Since it works for at least some of your pictures I think you just did not add the caption to the “Caption” field but to “Description”.