Yes I got the same issue but it got fixed in 21w15a. But the thing is that I hit a goat with my netherite sword because I was waiting for a long time for it to charge. It took a minute to realize, but it finally hit me (don't worry, I was wearing netherite armor).
I don't think goats were meant to attack in Java.
They are passive, and even when hit by a player they were meant to just panic and run around like sheep, cows, etc.