They don't necessarily. Some people do feel like they're not themselves after organ transplants. Like their hand isn't theirs after a hand transplant.. or that it has a mind of its own. Some experience personality changes or feel like the new body parts have their own desires.
Oliver Sacks and other neurologists and psychologists have written about and studied this phenomena.
Gradual brain replacement might have none of these issues, or it might have them, or even worse ones, or perhaps the changes will be more insidious and not noticeable by the people who they have them but could be noticeable by others.
Even in the best case scenario, when they're without these neurological or psychological issues, that would not clear them on the philosophical level. The questions of identity would remain.
The uploaded consciousness or gradual brain replacement are pretty different from this case, though, it's true. So maybe these issues wouldn't exist or not exist in the same way, but philosophical issues of identity would remain.