Why is the Cangjie code for 海 inconsistent? Here are some Cangjie codes:

母 = WYI

每 = OWYI

海 = EOWY

I understand the first two.  The YI encodes 亠 and 丶 which makes sense.  Shouldn't 海 be EOWI instead of EOWY?  OWI would be the first, second, and last codes for 每 the same way a character like 語 (YRMMR) is decomposed.
There are many rules for the Cangjie input method.
The one you don't understand thoroughly is the rule of omission.


  Omission in enclosed forms: when part of the character to be decomposed and the form is an enclosed form, only the shape of the enclosure is decomposed; the enclosed forms are omitted


Take a look 倉頡輸入法/取碼原則


  2 省略大原則
  2 The rule of omission
  
  2-2 包含省略：
  2-2 Omission in enclosed forms:
  
  尾碼被「外框」字根包住，且「外框」尚未被取完時，以「外框」的尾碼取代之。
  When the last code is enclosed by the frame radical and the codes of the frame are not completely taken yet, it is replaced by the last code of the frame.




The left and right ends of the "亠" protrude outward, therefore it is counted in the frame.