Barnett died Jan. 22 in Mexico, where he posted a photo of himself days earlier.
An autopsy determined the cause of death was “Non Traumatic Hemorrhage, caused by pancreatitis,” the Forensic Medical Service of Tijuana said in a statement to E! News. The service said on Thursday it still had the body, which was to be delivered to family members.
Pancreatitis is inflammation of the pancreas, which happens when “digestive enzymes become activated while still in the pancreas,” the Mayo Clinic says on its website. Severe forms can be life-threatening.
Barnett, also a stand-up comic, co-created the Fox comedy “Rel,” which premiered in September. He wrote several 2017 episodes of NBC’s “The Carmichael Show,” which had “Rel” star Lil Rel Howery of “Get Out” as a cast member.
Howery said he was heartbroken by his gifted friend’s death. Twentieth Century Fox Television and Fox Entertainment called Barnett “wildly talented.”