Maybe it was in how you knocked.
Also, I wouldn't put so much in the idea of "choice", like she chose to insult you. That's a bit much.
What you're describing is a mild version of an hysterical outburst. You startled her and she reacted to being startled. She spoke without thinking. There's not much choice involved in that, and it's as much self soothing as anything. By your own admission, she was rattled by your presence for some reason.
Did you choose to deliberately scare a woman just going about her job?
.........I thought not.
It's the same.
If I had to make a guess, it was something in thr knock, and nothing to do with your presentation and looks whatsoever. I base that on something a family member said once and she owns her own commercial cleaning company and has spent many a year cleaning public restrooms.