Yelled at a Rude Homeless Man in Church. Was I wrong?

I just feel so regretful about the whole situation. I’m actually crying right now because I could have easily just given him the pan of food calmly and he would have left us alone. In the moment I wasn’t thinking that this may be the only plate of food he has to eat for the day or week, and that he might be mentally ill. I feel like the biggest asshole and I’ve just been praying for God’s forgiveness now…