Edit* Zirenee reply explained
Without getting too much into the weeds here - This is how Solace of the Fallen/Defeated works in 3.3.5 so this is accurate to original WotLK.
Solace gains a stack on helpful or harmful spell dealt, not on healing or damage done. The game has a lot of interactions that count as different spells.
For Penance the only spell the Priest actually ‘deals’ is the spell that decides if it’s an offensive or healing Penance. Divine Hymn you only ‘deal’ the spell that self channels.
Another good example for this is a Mage has Solace (for whatever reason) and casts Arcane Missiles they get 2 stacks. Because they are dealing the channel, and then also dealing the spell to themselves that removes their Arcane Blast stacks. Arcane Blast gives 2 stacks because it is dealing the Blast spell and the spell that gives you an Arcane Blast debuff stack.
Weird? Yes. Bug? Not according to original WotLK.
Hope that explains it.
ye it does ty for clarifying