If you became like Darth Vader or Robocop you would still be alive and considered human because your ability to act as a human has in no way diminished. If the brain was taken away or there was an attempt to use your soul to animate a robot which your soul or personality would be transferred to, it would be technology, not God, that is attempting to keep you alive. Because God will not allow your soul to be defiled in this way by undoing your humanity and making it into something else, I believe he takes your soul away when the capacity to be a human creature is gone. Note that this is not the same as someone who is in a coma or is a vegetable. If God wills it, these people can be cured, and it’s not the same as not being human anymore, because God can restore the mental, physical, etc, attributes, because the organs are still there that they need to think and feel through.
A person who is now a robot is no longer human. Anyone who claims the personality or soul of the person was transferred to the robot is probably wrong. At best, they may try and create an A.I personality that can function on similar brainwave patterns, and this and that and the other, and it can mimic the human it used to be, but it’s not John or Jane Doe anymore, it’s a lifeless robot. It will never be the genuine article because the all-encompassing factor that made John or Jane Doe a human is no longer there- their soul.
Science fiction entertains us with concepts that bridge the gap, like artificial intelligence, or implanting a brain into a robot, and having the robot access the memory banks of the human and somehow mimic it, which gives the outward appearance that the person continues to live on, through the robot, etc. While these concepts make for entertaining movies that are thought-provoking, and rightfully so, they usually don’t have any spirituality to them, which if it were present, would explain how this just isn’t possible. If there is a spiritual element, it’s there as a plot device, and usually nothing more.