I've tried using AI(Claude) to do refactors/move code between languages, and in my experience, it has the tendency to go off the rails and just start making up code that does something similar, essentially doing a rewrite that never works.
I like to believe (it may not be true though), that the AI has learned what code actually exists in the wild, and is doing what all of us end up doing when trying to refactor a system we don't understand, writing new, similarish code as writing code is more fun than reading it.