Droideka
Droidekas, also known as destroyer droids (destroyers for short), or as rollies in clone trooper slang, were a type of battle droid used by the Trade Federation during the Invasion of Naboo and, later, by the Confederacy of Independent Systems during the C...
This is fairly directly inferred in Interstellar, as well, with TARS and whatever the other robot was called.
Like, he directly threatens TARS with that at least once, so, yeah, it's definitely a trope...
Can sort of argue that Star Trek did this with Data, on occasion, too...
It was rare because they actually did consider him sentient. There's of course the famous episode Measure of a Man, but the one I remember is when Picard indirectly threatened Data in Clues, when he found out Data was keeping a dangerous secret from the rest of the crew.