Hi, long time, no posts, sorry. We didn't camp last year due to a sick pup pup who had csncer

So camper sat in the driveway in the hot Denver sun all season (we did do 'driveway camping night' every couple of weeks which was fun).
A couple of weeks ago I noticed that the vynil trim molding along the roof edge (see photo, end piece only, but it does this same curly thing periodically down the track) has, yet again, curled up, i think it shrinks in the heat, pulling out of its track. Yet again I say because it has pulled out of its track every couple of weeks since I bought the trailer in 10/19. Mostly if I drive down the highway the wind pulls it out. But apparently sitting in my driveway is enough to make it shrink and pull out, all on its own! The dealer 'fixed it' when I first bought by adding a screw on the end, but said the trim was only cosmetic and would not be fixed under warranty by them again. Since then we've pulled it back into place with plyers and screwed it down again on the end, followed by sealant, a number of times. I saw where another owner replaced a similar trim but it was on the side of the trailer. He screwed it down every 12 inches (ugh...)
At this point, if it's only cosmetic and has no sealing purpose, I'd like to just remove it - pull it out of the track, expose the metal track, add some sealant on the screws, and be done with it!! But husband says there may be a legitimate purpose to this annoying trim.
So my question to the group is - does anyone know if this trim molding IS purely cosmetic?? Thus can I pull it off and live without this trim piece? Or, does it actually have a purpose? Some sealing mechanism some how? Requiring me to replace it and screw it down every 12 inches?