I don’t know how did you sorted the perment water ingress through the main hatch but I found simple solution.
To start with I made a template of the top part of the companionway. Than, using few pieces of teak, around 25mm thick glued together I transfered the template onto it and cut off the profile. The next step was to cut the groove at the bottom of the profile, around 1/3 of its thickness from its front side. This is to stop water running behind the hatch. It actually makes the rain water drip on the front side of the hatch instead of going behind it.
Here it is how it looks fitted:
and with the hatch closed: