Yes! Such surgery exist! This method is called "Ratationplasty"; as the name implies, it is done by removing the middle part of your leg , then the remaining limb below the involved portion is rotated and reattached. As a result, the ankle can alternatively function as a knee joint. This is considered to be one of the best surgical treatment for patients with tumors in or near the knee joint and usually, children are the best candidate for this procedure. For further information: https://youtu.be/zuMH3u0OLhA Link attached will provide you a very concise info about this particular procedure.