Praise be to Allah.
Shaykh, ‘Abd ar-Rahman al-Barrak (may Allah preserve him) said:
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.
And Allah knows best.