The study’s authors concluded: “Among patients aged 18–80 years admitted to hospitals with AMI between 2001 and 2020 in the United States, cannabis use was associated with lower risks of complications, … as well as lower in-hospital mortality despite correcting for several confounding factors.
I would hope that age was one of the factors corrected for, because the younger patients will likely be using cannabis at a higher rate than the older ones.
If the majority of your "have used cannabis" group are pulled from patients in their 40s and 50s, for example, you're probably going to see better outcomes compared to the control.