I've always been taught that starvation is not painful....and this person sounds like they died from something besides starvation so that's not an issue. The patient died in a couple of hours- you did what you could to make it comfortable.
No MD should yell at you. (actually, nobody should yell at you unless you're about to step in front of a bus
You didn't do anything wrong. You relayed family concerns- and you learned something. In the future, you can ask someone with more experience at the facility what they usually do in that situation, if it involves active life sustaining care with an actively dying patient. Sometimes, you will still have to call an MD. Other times you won't.
Doctors can be wonderful- and they can be a.holes....as with anybody. And sometimes they are nice one day, and lousy the next- just remember, you didn't put a gun to his head and make him go to med school, and it's not your fault he's on call
You'll learn how it all works- and maybe see if there are any policies in the facility about hospice care/actively dying patients... :heartbeat