Ideally, you want people deeply familiar with the original codebase doing the rewrite.
What usually happens instead is that the rewrite happens because the original code has been handed off to a new set of people. They're not deeply familiar with the code. It's confusing to them. It's not obvious why things have been done in a specific way. And so they decide rewriting it from scratch is the better option.
Unfortunately, they're not in the best position to come up with a solution that incorporates the right lessons from the original design.
What usually happens instead is that the rewrite happens because the original code has been handed off to a new set of people. They're not deeply familiar with the code. It's confusing to them. It's not obvious why things have been done in a specific way. And so they decide rewriting it from scratch is the better option.
Unfortunately, they're not in the best position to come up with a solution that incorporates the right lessons from the original design.