You are in essence creating a glass pressure cooker. What could go wrong?
When canning food in a mason jar, the lid is not on tight; gases can escape. When you take the heat away the vapors in the jar cool and create a vacuum sucking the lid on tight.
It's not the heat you have to worry about, it's the pressure. You need some way to let it escape above a certain level. The vacuum sealed bag in boiling water is a much better option. If it over pressurizes and you don't catch it, it will just put a tear in the bag. No flying glass.
Regarding putting weed into a mason jar to decarb. Greg nr is quite right. A lot of Carbon dioxide gas is given off. That, in addition to expansion of air in the jar makes the whole thing a Darwin award in the making. Loosely covered jars are probably safe but don't seal the thing tightly.
I've been using a vacuum sealed bag in nearly boiling water and finding good results. I didn't even have to dry my harvest before doing so. I cut up fresh buds from my harvest, sealed in plastic bags and used an immersion heater to hold water temp at 203 F (95C). Significant expansion in the bag due to CO2 that is a product of the decarb reaction. The bags have to be weighted down. Two hours at 95C is long enough to get the job done with the side benefit of less degradation of THC and better control of the overall reaction.
A test sample of fresh bud was dried in the oven to find out % water in the bud, which came out to about 25% dry matter/75% water
Once decarb is done, the bags are opened and wet decarbed bud is transferred to a jar and 500 grams of melted coco oil is poured over all. I use 100 grams wet bud/500 grams of oil (roughly 4 ounces per pound of oil or 1 ounce dry matter/pound of oil). Mason jars are sealed and go back into a water bath held at 190 F (88 C). Extraction time in coco oil is 2 hours at 88 C.
Oil is separated using a french press to get most of the oil off. I use an old orange juice-press to squeeze out the last bit of oil from the bud. A little water comes out of this, so I let it cool and remove the oil cake from the last bit of water. This very last step isn't very important -- it's a very small amount of water, I'm just fussy after all the time spent to get to this point.
I've made plenty of canna oil using the conventional 240 F/30 minute oven decarb method and I think the boil-in bag decarb method gives me better results. I've done side-by side tests and subjective comparisons of the highs from each tilts me to boil-in bag decarb. Less smell too.