In Pokémon Brilliant Diamond and Shining Pearl, Friendship and Affection are one in the same. As a result, Friendship works as it normally would, though at certain stages of Friendship, previous Affection bonuses, such as surviving a hit on 1 HP, are now effects of Friendship. As a result, yes, in BDSP, fainting does lower Affection/Friendship with a Pokémon.
In games where Affection and Friendship are separate features, though Friendship is lost when a Pokémon faints, there is no way to lower affection, only raise it.
Source