Solved by albanD in post #4 
              
              
                gradcheck checks for “true gradients”. 
For your function, the “true gradient” would be 1. But you deliberately set it to -1. So there is no way indeed it can pass the gradcheck.