Most knee replacements go really well, I've known several that have had them and recovered quickly.
Every once in a while though, they go very badly. My dad is on day 14 of recovery after replacing the same knee twice in 6 months, here's what happened. He had his knee replaced and was recovering well and then started getting some swelling. Went to the Dr and they drew some fluid, bad staph infection so they hospitalized him and put him on strong IV antibiotics. Eventually they sent him home and a home nurse came a couple of times a day to administer the antibiotics. After a bit the knee tested clean so they switched him to an oral that he would have to take for the rest of his life. A few weeks go by and he's got some swelling again, goes to the Dr and they draw 50 - 60 ccs of fluid off the knee and test to find the infection is back. They scheduled him for surgery to remove the knee and install a bar, often what happens if there is an infection is it gets on the knee replacement and can't be cured without removing the knee since the antibiotics don't get to it. He went to a rehab hospital after that surgery for a few weeks and then home, again on very strong antibiotics. 7 weeks post-surgery, they culture the knee again and find it's clear of the infection so they schedule the replacement again. That surgery went well and he's home from the rehab hospital for about 4 days now. Range of motion and mobility this time are nowhere near where they were after the first replacement though and the Dr is telling him he may not get the 120 degree bend he needs to ride his bike again. Recovery is going slowly and is much more difficult this time, he's walking on a cane but, not very far. He will have to take the antibiotics orally for the rest of his life now.
I'm not sure what could have been done differently by him to have avoided this, I don't think anything. This is a hospital problem that came from not cleaning everything properly either for/during the surgery or sometime in his post-op care. I think it's just the luck of the draw. The only thing I would say as a take away from this is if you have a joint replaced and get an infection in the joint after surgery, demand that they remove the joint instead of just trying an antibiotic course first to see if it works. I had a customer some years back that had a hip replaced and his journey mirrored my Dad's in both time and results. In both cases, if they would have just removed the joint, recovery would've been faster and I'm sure would have resulted in better range of motion following the 2nd replacement. I think insurance wants to try antibiotics because it's cheaper but, based on what I've seen, I don't think it's the best course for the patient, only for the insurance company's bottom line.
I'm not trying to be a naysayer, as I said in the beginning, most people I know that have had them had no complications and are glad they did it. I just wanted to share the possible negative outcome and what I came away from those with in case you experience something like it, which I sincerely hope you don't. Both my dad and the client were in a great deal of pain throughout it all and got very depressed, I wouldn't wish either of those on anyone.