The reason why plants are able to produce phenypropanoids is the presence of compartments. Bacteria can also have inclusion bodies but this wouldn't allow proper sequestration of the compound and would lead to toxicity/inhibit growth.
I don't think it has anything to do with compartmentation. Because, by that reasoning, any kinds of toxic substances would be rare in bacteria, not just phenylpropanoids. But we know that's not the case.
In my opinion, it's less about phenylpropanoids being rare in bacteria, but more about them being very common in plants. This would probably be because the phenylpropanoid pathway is an important pathway to produce precursors for lignin, a ubiquitous substance in plants. And during evolution with random mutations, these precursors just happened to branch off into different other substances that were beneficial to plants and thus kept.
The phenylpropanoid pathway serves as a rich source of metabolites in plants, being required for the biosynthesis of lignin, and serving as a starting point for the production of many other important compounds, such as the flavonoids, coumarins, and lignans. But in there is no organized cellular organelles