In the US, it depends on why you are doing this, and how you go about performing the operation. There are approved devices and procedures, and there is the other stuff. In an emergency that is life-threatening or threatens severe debilitation, it is permitted for a physician to try an extreme measure – if the state has a "Right to Try" law. Otherwise, a review and official approval by the relevant IRB is required. The devices are regulated by the FDA, but the FDA does not regulate the practice of medicine, so the feds don't have a say in whether a procedure is allowed. Nevertheless, use of unapproved devices can be taken to be evidence of failing to meet the required standard of care, in the case of a malpractice suit or punitive action by the state regulatory board.
There is no specific law prohibiting removing lots of organs and replacing them with prostheses, though arguable what happened was that the brain was removed (it's not that a replacement shell was built around the person). Ordinarily, intentionally "killing" a person is illegal (except in case of sanctioned execution or self-defense). There is zero case law that would tell us whether removing a brain from a body "kills" the person. Most likely, there would be a prosecution for unlawfully causing a death, and either the legislature would tune up the law w.r.t. the definition of "causing death", or the courts would do so.