Are you elevated above him and the zombies has no path to you?
I notice when I'm in GodMode flying around a test world that zombies will attack things like light posts. I think they're trying to make me fall down, or something.
Nope. Standing on flat ground, nothing between me and them. They could straight up run to me and hit me, but like 3m in front of me they sometimes take a sharp turn and attack a tree or lamp post and stare at me while doing so. After a few hits they then realize something is wrong and proceed to aattack me.