Help debugging `nlopt failure: -1` errors

The most common cause is that your gradient is wrong, and so the algorithm gives up.