A protocol droid being able to feel pain ( or the appearance of pain) and a walking battery being programmed to feel pain are two entirely different things. Protocol droids were made to have a human like appearance and , in the case of 3P0 especially, human traits. These things would have been programmed into them because of their function: to converse with other life forms. A Gonk droid is just a walking battery. Why bother programming any emotions into something like that?
One the main reasons i hated that scene from the first time i saw it is the god awful voice is was given. Suddenly a gonk droid can talk and say “no”? It was given a babyish vocal and sounded ridiculous. If that was supposed to show the droids peril in Jabbas palace, then it fell completely flat and made something that could have been perilous into another facepalm humour moment. And, if it was meant to be humorous, it failed because no one laughed during the many showing i saw in '83, and this was back when the audience got involved with the film, cheering, clapping etc. The droid being pulled apart had the same stupid kiddy vocalising. That type of silly-vocal style plagued ROTJ and then grew with the prequels (and then the new=SE with obi-wan’s howl). Then we have salacious crumb, Chewies Tarzan yell, the ewok during the speeder chase…Even R2 suffered with his now baby like sounds. Ridiculous sound effects/ vocals. These things have to be changed. There are so many parts of ROTJ that just seem like a failed, comedic parody of Star Wars.