Usually what's under trim, lights, vents, etc. is buytl tape. For caulking, an RV caulk is what we use (after using silicone a long time ago, before the days of the Portal, and paying the price of trying to re-caulk again later on). Dicor is one brand, we usedanother RV brand from our dealer last year or the year before, when they were out of Dicor. Self-leveling for horizontal surfaces, non-self leveling for vertical or sloped areas.
This product in the pic is what the factory will have put around your 4 corner end caps of the roof. The side rails would have a water proof tape product under them (butyl tape). To fix it to factory specs you'd have to pull it all apart and replace the tape, then reseal the corners. I wouldn't open that can of worms, just use the same product as the corner caps