The rubber trim is part of the OEM BMW window, which zips in. Mine came off, too. And the edge of the canvas did not look good where the previous owner had used glue to try to hold the trim on.
I bought a new OEM window but was unable to get the zipper started. Then I bought an Emiata window which is easier to zip, but uses a glued canvas edge that is both the seal and the trim. I didn't like the look of the quality, so I returned it. Then I bought another OEM window, but both I and a shop were unable to get the zipper started. So I bought a new top.
If your window does not leak, I would remove the trim and live with it. Otherwise, buy the Emiata window which you will likely be able to zip in. However, some people make a mess with the glue for the canvas edge seal.