Thanks Zoly,
a very good page you found.
this is one explanation for
these small doors, but only partly correct according my knowledge. than these doors would be on all deck levels.
Because these small doors are mainly installed only at the main gundeck but not very often on the upper decks, there they had normal closed lids without these small doors.
For example the lids of the HMS Victory
For me the best understandable explanation for this circumstance (only at lowest gun-deck) is:
When the ship is sailing without having action or training for action (which was 99% of the time) these lids of the lowest deck were closed,
the only ventilation was to the other upper decks were only via the gratings - and these small doors !
But I will check this / my opinion once more during the evening, with looking into different publications
Refering the gun port inner lining:
In my opinion, they have to be there, maybe only small difference, but it was technically necessary.
Without this lining the lid would be not fixed or locked and would swing with every movement of the ship.
In addition with this lining, an additional safety is given, that the seawater is not coming into the ship during heavy sea - because of this step in cross section you have better waterstop.
a very good cross section from Boudriots 74-gun ship publication
and once more the Victory
gunport lid thickness is identical to the planking thickness,
I completely agree with
@janos explanations - you can see this on all photos of the Victory