John Gilbert Getty -- one of the heirs to the Getty fortune -- died from complications related to a fentanyl overdose ... TMZ has learned. The Bexar County Medical Examiner's Office in Texas tells TMZ ... John died of cardiomyopathy and chronic…