After belonging to this forum for a long time, I really have come to the conclusion that this is not about how people act. As in, if a person does 'this' and does not do 'that', they will raise up a perfect rooster. Roosters are crap shoot, sometimes you get a great one, (and therefore think you have it right) and sometimes you get a rotten one, (think you must have done something wrong). Truthfully I think it is mostly the luck of the draw.
One should always be aware of a rooster. Roosters are opportunist, I would not think it is a change in surroundings, I would rather expect, that your attention was somewhere else, and he saw an opportunity to get you.
I have lived amongst animals my whole life, wildlife and domesticated. We are cattle ranchers, species of animals tend to hang together and ignore other species unless it is prey and predator. I highly doubt the idea that a rooster thinks a person is a hen.
Generally - people are startled, then horrified, then deny it was the rooster's fault, then with repeated attacks, finally come to the conclusion that they have to do something different, the darling boy is not coming back.
Most of us, have kept a rotten rooster way too long. Beware, I think he will attack again, when you have something in your arms, or are bent over or squatted down to fix something. Or he is behind you, while your attention is somewhere else.
Each of us has a different tolerance of this behavior.
Mrs K