I hear this all the time, that pets can sense anguish and try to comfort you. It makes me miss having the opportunity to have had a pet, despite the care needed.
On the flip side, even standoffish pets can have a change of demeanor under poor circumstances. One person was talking about when her cat who had never even been friendly towards her was dying, it sought her out. The cat was terrified, so they went to the one place where they felt safe. The person telling the story felt oddly comforted that the cat ultimately did have some feelings for her.