I caught the trailer of a (Spanish?) film a few months ago. Set in the near future, there was a scene where the main character was working (touring?) a laboratory where robotics students were learning how to make highly lifelike (but miniature) horse robots.
While observing the students, one of them makes a mistake (he forgets to give some sort of verbal command?) and the horse suffers agony, writhing in pain before eventually dying (possibly as a result of his having finally given the right command). The main character then uses this horrifying incident as a teaching tool, stressing that if mistreated, these robots have a tendency to die unpleasantly and can't be repaired.
I recall he was building a larger (human-form?) AI robot, possibly in the form of a young girl or young woman.