I think you have the bottom part right in V1, the PMOD connectors are as low as they can go on my board and sit on the bottom edge OK. A little extra clearance wouldn't hurt to allow for variations in pins/soldering but I don't think that is causing the 1.5mm gap.
The top part does need more depth. If it helps on my Mx the top of the hdmi socket is 12mm above the bottom PCB. You may wish to consider having a parameter to set the height of the core as well as coverH to allow for adjustment. Also, future Core modules may vary in height and layout so there would be a degree of future proofing.
The parameters in your v2 model make it much easier to adjust things - I will try printing a new top cover after adjusting the roundedcube Z parameter to establish the extra core height, changing coverH and bottomTranslateZ to extend the top and bottom cover depths to accommodate the thicker core.
Once I have a good fit I will post the changed parameters.
Once again, thanks for providing an openscad model - it provides proper access to the source unlike the majority of models that are STL which is not a true source form.