Replaceable…. Did mine a few years ago. Meant to sit flush. Try pushing it back into to its “track”.
If this picture attached properly…. It’s from realoem.com … for my vehicle…. ‘04 3.0i …. Trim piece for around the windshield.
https://www.realoem.com/bmw/enUS/par...&q=51317017021