Why wp_set_password not working within a api endpoint?

Why wp_set_password not working within a api endpoint?

tech