However that doesn't mean this is the global optimum. There are probably ways to reduce hand off errors, e.g. by introducing hand off check lists. Sleep deprivation errors on the other hand can only be reduced by reducing sleep deprivation, giving crystal meth to the doctor (probably unethical and unsustainable) and by general poka yoke style changes that will have benefits even when not sleep deprived.
So the global optimum can probably be shifted to somewhere where the doctor is not sleep deprived and the hand off is organized. Which is also more humane towards the doctor.
After eg 6h of work, don't accept any new patients, but finish treating the ones you already have, if possible.
In this case one procedural way to make this better would be to teach doctors to write up anything unusual they notice during the day, and read this list of unusual events during hand-off to the next doctor.
Presumably the constraint here is having an integer number of shifts per 24-hour day - 3x8 hour, 2x12 hour, 1x24 hour and so on.