Well, you know, that’s a double edged sword. I certainly agree that pain is the most frequent cause of misbehavior. But- even if it’s the cause- the horse has to be schooled as to acceptable reactions. So yeah, if they buck due to pain, you get after them for bucking, anyway. And look carefully for the problem so you can come up with a solution.
To try to put it in context- flight is a horse’s first instinctive reaction to a fear stimulus. A big part of our training is to squash that reaction. Bolting is unacceptable, horse, even if you are afraid. So it is also with reaction to pain/discomfort.
Another thing to keep in mind is that, when a horse has learned an evasive behavior in reaction to pain- sometimes it will find other ways to ‘use’ that new skill (most frequently, bucking)- even after the pain issue has been resolved. Particularly if the bucking successfully unseats or intimidates the rider.
Following on Equibrit’s post to which you took exception- one of my good hunters once, seemingly inexplicably, slammed on the brakes at a coop while I was whipping in. I put him at the fence a second time, with a whack of the whip for good measure, and over we went, with no further incidents the rest of the day despite lots of galloping and jumping. Sure enough that night, after returning to the barn, he showed a tiny bit of soreness in a stifle- probably the source of discomfort that caused him to quit at the fence. Of course I felt bad about that. But the horse sure didn’t hold it against me.