Dear Ray,
Something is fishy on the images you are pasting. Because, I can see that you are calling the function forward_propagation(X,parameters,n_y) yet when you are showing the output after running the code it seems you are calling it with only 2 parameters (instead of 3). So, I am wondering what you are doing? Can you please elaborate on this?
I agree with @yjcb22. The two halves of your thread do not agree on the code you wrote.
Please explain.