Feck, that's just tragic. Absolutely awful.
The guns they use to fire blanks are sometimes real, functioning firearms (reading up on it, the use of functional, non-modified firearms is, fortunately, quite rare these days). They need to be modified to enable blank cartridges to cycle the action, however, which often involves using a barrel with a very tight choke point in it. Such a choke point has a secondary function of making it harder to accidentally fire a live round (it'll make the barrel explode. Still dangerous, mind, but much less likely to be fatal), though ideally it's been modified to make it impossible to chamber a liver round at all.
This was a western, though, and in the old west they used revolvers, break-action shotguns and, in the later era, pump-action shotguns. None of these rely on the energy of the bullet firing to cycle, the all have manual actions, meaning there's no need to choke the barrel. Thus, if you're using real firearms, a mixup it all it takes for you to have a live, lethal weapon.
With Brandon Lee, what happened was that they used an functional firearm (a revolver). Their dummy bullets (inert rounds that look like the real deal, for scenes where they show someone loading a gun) were improperly made, as they had left the primers in (the thing that the firing pin/hammer hits that then ignites and detonates the powder.) At some point, someone pulled the trigger with one of these "dummy rounds" in the chamber, and while the primer wasn't enough to send the projectile down range, it did cause it to separate from the casing and get lodged in the barrel. The same gun was then used to fire blanks, without having been properly inspected to ensure there were no barrel obstructions. When the blank was fired, it had enough force to dislodge the projectile stuck in the barrel and send it out with enough force to kill.