What you are reading is a novel of rebirth or crossing. Because the name of the protagonist is different before and after crossing, the name changes after the protagonist accepts a new identity.
The protagonist uses an alias to hide his identity, and the author changes the protagonist's name for convenience.
the author's brain is confused because he has changed two or more books, which leads to the wrong name of the protagonist.