Couldn't some of those stomach bacteria be patched to produce Vitamin C? I suppose some humans already have such bacteria in their gut, without knowing it?
Yes, but what's in it for them? Vitamin C synthesis uses a lot of energy. Patched microbes that mutated to stop making vitamin C would rapidly outcompete their ancestors.
That can be dealt with, just like nitrogen fixing bacteria in legumes are punished if they try to cheat. All you need is some method of signaling who cheats and who doesn't.
The second paragraph in the section you linked to discusses how the plant punishes cheaters.
I don't think there is a definitive treatment. There are lots of experiments and many possible mechanisms that have been discovered or proposed, and probably all are used by the plant.
Colon bacteria are all mixed together, so selectively rewarding symbiotes is hard.
And anyway vitamin C is sufficiently energy-rich that if a bacterial species started making it in quantity, other species would rapidly evolve to eat vitamin C for energy.
Currently the immune system prevents bacteria from living too close to the cells of the intestines (they have to stay in the mucus).
Setup a signaling system where bacteria that make vitamin C are permitted to stay close, and are shielded from the actions of the immune system. This lets you selectively host those bacteria, and it puts the vitamin C right where it can be immediately absorbed before other bacteria can get to it.
It also punished cheaters, since without the vitamin C the immune system would attack them and force them to stay farther from the food.
It's not much father from there to a dedicated organelle (or cells) the specifically host desired bacteria and all others are killed by the immune system.
And from there the host might incorporate the genes from the bacteria in the same way mitochondria are setup.