Consciousness is the result of the brain, a mixture of senses,memories and a complex communication between the neurons.
To make an example see neurons as people, having 10 people there doesn't do anything.
But if you give those 10 people something to talk about they will create a conversation, this conversation is the consciousness of the group.
If one of the ten people dies and gets replaced the conversation and so the consciousness will change and lose or gain new qualities.
Over time these 10 people will die and be replaced causing the conversation to deviate completely from the original group.
In short, we all die slowly over time until there's nothing left of what we used to be.
Replacing the neurons of a person with nanobots would be exactly like killing that person and having someone replace them that thinks to be them.
1-Jimmy is alive and knows it.
2-Every single cell in jimmy's body gets replaced by nanobots.
3-Jimmy is killed by the nanobots.
4-The nanobots give life to Jimmy-bot.
5-Jimmy-bot is alive and knows it.
6-Jimmy-bot doesn't remember about the existence of the original Jimmy therefore now Jimmy-bot became the true original Jimmy leaving the old one in the oblivion.