No, not really. You'd use a strain that can't synthesize a certain molecule and then have that molecule inside that capsule. If it gets out, it can't reproduce any more. Those bacteria also can't compete in a natural environment because they evolved in a lab and were engineered to do something detrimental to the usual "microbial fitness".
The only risk worth discussing is that they could pass on antibacterial resistance genes to other bacteria. Even that is not really that much of a risk, because the resistance genes used in such studies are usually already quite widespread.
I'm not saying that's what's going to happen. I'm just pointing out that's how the scientists were supposedly containing the dinos. 'Can't produce the amino acid lysene.'
Again, I'm not saying it's not feasible to prevent 'that' molecule from synthesizing a certain molecule, but observation tells us that life really does find a way...
Fortunately, the world is not a movie and there are many ways to contain organisms by making them depend on non-canonical amino acids which do not exist in nature. Making them depend on multiple means that them acquiring the ability to produce them is astronomically low
Yes, it's possible to reacquire the capability to produce something like an aminoacid. But because that has to happen extremely quickly, before the organism dies, that's extremely unlikely. And then that bacterium is still vastly inferior to all the other ones. And it doesn't have any scary properties in the first place.
The only risk worth discussing is that they could pass on antibacterial resistance genes to other bacteria. Even that is not really that much of a risk, because the resistance genes used in such studies are usually already quite widespread.