I need advice!! Our dog is having issues

We moved to AZ from UT in August, when our dog was about 7 months old. I am not sure if it was the stress of moving or some really negative interactions he had upon moving here, but he has since had behavioral problems. A few weeks after moving here a random girl (About 3 yo) came up to him at the park and he nipped her. He also really dislikes the other dogs in our complex and has acted aggressive toward them, but has never hurt them because we keep him on a leash. He is mostly fine with people but doesn’t really get to interact with them much now because people think he’s mean so we keep to ourselves. Occasionally he has barked or growled at people passing by. The thing is, if someone is in our home or we are at the dog park, he is perfectly friendly. (He can get scared of other dogs at the dog park but usually warms up pretty quick). Anyway all this time has passed and I thought we had gotten into a good routine but now our HOA is saying they want him gone all the sudden. It’s infuriating and heartbreaking and I have no idea what to do. But mostly I’m just wondering if anyone has had a similar situation where your sweet pup all the sudden started acting this way? We have been trying to work with him and I feel like we’ve made progress so I feel super blindsided by the whole thing.

(Edit: to clarify, the little girl does not live in our complex. She is related to someone who does though. This happened at the park across the street. I thought we had settled everything, she was fine. So now 6+ months later I just can’t believe it’s an issue again)