Hi Wezz!
The kitty doesn't hate you! Happiness can only increase by petting when it's done by the owner, it might have been a coincidence that your friend kitty's happiness increased while you were petting it
Changing ownership doesn't affect the fact above, so even if the kitty used to be yours, you won't be able to increase it's happiness by petting it unless your friend sends it back to you.
I hope this helps
Giulia