I’ve also done the 'sup head jerk with cats around the neighborhood, they start in surprise the first few times, then do it back.
It’s apparently an acknowledgement/greeting between cats.
And yes, heed the advice to “ignore” cats until they approach. Sit calmly, do your thing, let eachother know you’re there, and then wait. Often doesn’t take more than 15 minutes.
So happy for you! The world is better off for your empathy and care <3
Thank you for letting me help, and hope you both have a better life from your encounter!