It looks like you are talking about the Week 3 Planar Data Assignment, although you don’t explicitly mention that.

Your implementation of dZ1 is incorrect. I think you are missing the convention that Prof Ng uses to distinguish between elementwise multiplication ("*") and dot product. Here’s a thread which discusses that. After reading that, please have another look at the formula given in the instructions for computing dZ1. There is one dot product involved and one elementwise multiplication, but you used dot product for both.