Humanity is already too good at solving its own diseases; our single biggest problem is overpopulation.
If AI solves Cancer or Heart Disease tomorrow, we'll continue outbreeding our environment. If AI somehow solves Global Warming and food shortage, history has shown that we'll find some other way to hurt ourselves. It can't stop humans being bloody stupid and working against their own interests, unfortunately.