That’s not to trivialize what a compiler does, but it’s effectively going from a complex form to its building blocks while maintaining semantics.
Changing high level languages introduces fundamentally different semantics. Both can decompose to the same general building blocks, but you can’t necessarily compose them the same way.
At the simplest example, a compiler backend (the part you’re describing) can’t reason about data access rules. That is the domain of the language’s compiler frontend and a fundamental difference between C++ and Rust that can’t just be directly derived.
This is "lets put our postgres database on blockchain because I think blockchain is cool" level of crap you see in peak bubble.
AI code generation is not deterministic and has no guarantee of behavior, thus requires review unless incorrect code is acceptable.
You don't have to use AI code generation to be what is generating the code or you could require some kind of proof of equivalence to verify the code that was generated.