Think of it like this:
You're constantly changing, and the atoms that make you now are completely different than the ones when you were born, or even ten years ago.
This loose concept can derive many attempts at justifying something like this "reprogramming" of an individual's mind by arguing that it's just a faster version of these constantly occuring "deaths" and "rebirths" of an individual over the course of their life during every frame of their existence and that, as you say, "intent" is not important to the morality of an action (Kant has something to say about that, but honestly screw Kant that guy was a douche).
BUT, you're wrong as far as I can tell. Think of this: regardless of your previous beliefs, imagine you will "die" if you no longer have brain cells. You're constantly changing anyway, so let's take one of your brain cells and replace it with a mechanical replica. That part of your brain is dead, but continues to more or less function. Every day we'll replace another brain cell, a slow and gradual process. The living cells will have time to be accustomed to the nonliving cells and by working in unison they will be able to complete things just as they always did and your development will continue seemingly unaltered from the original plan. What happens when all your brain cells are mechanical? To your CONSCIOUSNESS, that is. Your body will still be able to hold a conversation and react to stimulus exactly as you would have while alive, but will it actually have a consciousness viewing the data as we presume we do while alive? From your perspective during this process, would your world slowly become dimmer and dimmer until finally you felt like you were just a passenger in your own body going along for the ride, then an observer, and finally nothing?
Your answer to this and related questions will determine your sense of morality about this situation. Think carefully.