Waypoint hook on_failure = "failure"

hello,
Could help,
I have the following problem.
When using the hook with the function on_failure = “failure”, I am getting an error and the routine continues. Should stop the pipeline.

hook {
when = “before”
command = [
“./scripts/gradle.test.sh”, “GRADLE TEST”]
on_failure = “failure”

Screenshot_1