One of the meanings of "to fail" is "to not help someone when you are expected to do so" e.g. He failed her in her moment of need. [Cambridge online dictionary]
As English goes, "to not fail someone" is a bit more formal and, in some regions, it is also dated English.
When you negate "to fail", you reverse the meaning: "He did not fail her in her moment of need." means that "He helped her in her moment of need."
The exercise "The dog does not fail him" means that "The dog helps him when the dog is expected to help him."
AugustLindemer offers an excellent example about a guide dog.