I was taught, if it's just a whoopn' you don't draw.
It is just not that cut-and-dried.
It is certainly true that just because someone is beating someone else, it doesn't mean you CAN automatically respond with lethal force. But similarly speaking, if someone is beating someone else, it doesn't mean you CAN'T respond with lethal force.
The totality of the situation makes a difference. Is there a significant disparity of force? Demonstrated lethal intent? Lethal ability? Are the requirements of AOJP met?
In the case of someone beating on a uniformed police officer---are they beating his head into concrete? Are they attempting to take his weapons? Is he screaming "I'm gonna kill you pig!" or something similar?
As people have said, sounds like about as clear-cut a case as possible though, for a third-party intervention: 1) uniformed officer, 2) direct assault on such, 3) direct request for aid from uniformed officer, 4) specified type of aid requested.
Given the situation, even if the police officer had been WRONG about whether or not the requested level of aid was legal, the bystander would be able to argue (successfully, I'll bet) that if they can't believe a police officer in proper use of force for defense purposes, who can they trust?