Note, this answer where posted prior to the latest update, and as such, answer the initial code sample (the one within the question) differently. The edited version of the question is brilliantly answered by Michael.
First, the inner space has nothing to do with CSS Grid, margin or padding, it comes from the fact that an img is an inline element, which like characters has a white space, for descenders, below the baseline.
One solution for that is to add display: block to the .grid figure img rule.
.grid figure img {
display: block;
width: 100%;
}
Second, the outer space is caused by the grid-auto-rows, so remove that from the .grid rule.
Regarding your Fiddle sample (and added screen dump), where neither matching the inner code sample, and after the above adjustments, there is still a small inner space, which is caused by the fact that the sum of the smaller elements height does not match the highest one, nor does its images, as the highest image is 123px, but smaller images are 120px (2*60) and 117px (3*39).