It was just Oda's way to avoid shitting on King while also allowing Zoro to get three great moments on Onigashima (scar + hakai + YC1 fight).
The medicine came out of nowhere, but deus ex machina solve things that the author have otherwise no way of solving and this doesn't match that criteria. Oda could have solved hakai differently, avoided it entirely, simply have Zoro beat King while half dead, etc.
So while it came out of nowhere, it's not a deus ex machina.
And neither is Gear 5. A retcon isn't a deus ex machina.
It's not like the medicine changed the lore or anything significant in any way so it didn't even bother me personally. It just led to another Thriller Barkesque moment of Zoro enduring more damage than anyone else and surviving.