Praise be to Allah.
If delaying the surgery until after Ramadan will exacerbate the sickness, or delay recovery, resulting in hardship and trouble, or the delay will result in problems, such as if the alternative appointment is relatively far off, or will cause you to miss out on having the surgery performed by a skilled doctor, then there is nothing wrong with doing it in Ramadan, even if the surgery causes the patient to break the fast.
But if it is possible to delay it until after Ramadan without causing any hardship or difficulty, then it is not permissible for the patient to break the fast because of that, because the fast of Ramadan is obligatory, and cannot be omitted because of something that it is possible to delay.
This is a summary of what our Shaykh, ‘Abd ar-Rahmaan al-Barraak (may Allah preserve him) advised us.
See also the answer to question no. 141646 and 12488
And Allah knows best.