We had an Australian Shepherd when I was a kid. He was the greatest dog ever.
Smart and very loyal to their family.
We had two at different times.
One of them nipped my wife on the hand because she (the dog) did not want my wife to help load a nut case horse on a horse van.
She kept trying to herd my wife away from the horse and when the wife paid no attention, she nipped her just as she would have cattle or sheep. No problem. It showed she was thinking.
Incidentally a few minutes later the horse almost killed me. A young mare, she kicked back at me intending to hit me in the face. The hoof went right over my shoulder within inches of my head.
It scared the driver more than me.
Years and years of handling and loading horses but one careless moment almost got me.
The dog was smarter than I was.