I am so sorry that this happened. I agree with the others, try to stop the what ifs. Everyone has a predestined time that is beyond our knowledge and control. You will not only grieve for him, but for what could have been between both of you. You said in the OP that you wanted to fix him. You had a plan for what could have been for him, no matter if it included you by his side or not.
I truly hope that his family understands that although it would probably not be appropriate for you to plan his funeral, you should be a part of it. Hopefully, you have a good relationship with them.
My DH felt so badly when his dad died last year even though they had been estranged for 20 years. It affected him, too, for what could have been.
I hope you find peace soon and can find yourself remembering the good memories that you have of him.