First of all, I'm very sorry for your loss.
Secondly, you knew he was receiving care from trained experts. And you showed up to be with him, which is a hell of a lot more than some people would be able to do.
In my experience, when it comes to the death of a loved one, there will always - always - be regrets of this nature. You'll always be searching for the thing you could have done differently, or the thing you did "wrong." It takes a long time to get to, "I think I can live with it."
Or, to mix episodes, it is possible commit no mistakes and still lose.
And how funny is it that there's an episode of Star Trek named after a Batman movie?