See summary. It should be impossible for a player to get rid of a possible surprise raid just by drinking milk.
How to reproduce:
- Give yourself milk
- Perform "/effect give @s bad_omen"
- Drink the milk
→ You no longer have a bad omen
This is probably unintended, because the developers wanted the player to keep their reputation among pillagers for killing their leader until he or she dies.
A possible way to fix this is to make bad omens player/mob attributes, rather than status effects.