I think it's luck - until you have L3 Alchemy, there's a random chance that each potion will blow up. L2 Alchemy makes the chance smaller, but doesn't make it zero.
It doesn't matter what potion you are trying to make, either.

I don't know if the potion-maker's skill helps, either - the TC might or might not make a difference. I always try to use a skilled scientist, but don't know what that does.

I've had random strings of luck - sometimes I could make several potions in a row without explosion, sometimes I would get several explosions in a row. Kinda like rolling dice (sometimes you get the same number a bunch of times, sometimes you don't).