DLS Course 4 [Week 1] Exercise 3 - conv_forward - wrong Z mean

If you mean that the range of the loops includes the stride, that is your mistake. The striding happens in the input space, but the loops are over the output space (the dimensions of Z) and you must touch every point in the output space. The skipping caused by the stride happens only in the input space.

Did you follow the link I gave earlier in this thread? If my explanation above is not enough to get you to a correct solution, please read this post.