Lots of ways to do it
There are almost as many solutions to this as there are RV's.
One big choice is whether to make the baffles seal onto the ramps themselvs, or bypass the sides of the ramps and seal on the cowl surface. I think a lot of people do one of each - the outboard baffle seals onto the ramp, but the inboard baffle (around the front of the engine) seals to the cowl top. Thus the channel through the ramp must be closed off.
What I did was maybe unusual, but seems to work fantastically well. I extended the ramps outboard to intersect with the cowl side. This gave me all the width I could want to make sure the outboard baffles had a good surface to seal on. It seemed to me that the ramps were just a bit narrow and it might be possible for the rubber seal material to miss the ramp and fall outboard of the ramp edge, just as you are thinking. So widening the ramp all the way to the side of the cowl prevented that.
Then, I closed off the inboard end of the cavity under the ramp with an angled "rib" that blends smoothly onto the cowl surface. My rubber baffle material on the front baffle makes a transition from sealing against the ramp, to this angled side rib, to the upper cowl surface. This was pretty complicated to figure out at first, but seems to make a complete seal around the front of the engine.
My cylinder temps are 260F - 290F at cruise (24 squared), and on a 90F day, a climb to 8000 ft gave max cylinder temp of 375. Thats the hotest I've ever gotten.
Its an IO-360-A1A (angle valve 200 hp).