LLMs are terrible at that in my experience. In what world is refactoring "very local in reasoning"?
Switching libraries/frameworks or switching piecemeal to a new language for a codebase that's already well structured seems like it would be noticeably less costly though.