Joining more objects breaks fill
Here are several ways to do a series of slots on a surface:

Beginning with the grid:


Create a plane, subdivide it:





Extrude its border, round it with an AltShiftS (or give the outer shape you want).





Select the faces you want and extrude down.





Continue to work on the shape.




Knife Project:


Create your surface object.





Create a plane, subdivide itd.





Delete the faces only.





Put your grid object above the surface object. Select the grid then shift select the surface object, then go in Edit mode. Then in the header menu choose Mesh > Knife Project.





The operation has cut the grid on the surface. As you can see and as I explained, if you cut a shape within a shape, you necessarily have an edge connecting the inner shape with the outer border.





Bring some correction so that your surface has a proper topology, i.e. edges that connect to the border edge and quads rather than tris or ngons if possible. Use the join tool (J) to join vertices. Create vertices on the border edge if necessary.





select the faces you want and extrude down.





Continue to work your object.




Arrays and Boolean:


Create an array of cubes with 2 Array modifiers.





Apply the Array modifiers. Delete the cube you want.





Bring your submarine object, give it a Boolean modifier with the cubes object as Object.





Apply the Boolean modifier, bring some corrections to have a clean topology.