There are several different test cases there with different values. It appears that you must have hard-coded the return value for n_y
so that it happens to pass the first test case, but not the second one. Or perhaps you are referencing global variables from the body of the layer_sizes
function instead of the actual parameters being passed in.