Yes. Obesity has been linked to heart and lung complications from surgery. Surgeons like to do surgery. A patient should sit up and take notice when a doctor refuses to operate. Losing weight would be in your best interest for a good operative result.
Whether or not you need to lose weight for a good result with the knee replacement is still uncertain. It makes sense that less weight and less stress on the implant will mean it lasts longer.
But there’s really no data to show that being overweight means a worse result. This may not hold true for patients who are extremely overweight. Studies have not reported results for patients in this group.