'〜ことがある': Occasional Occurrence ('Sometimes / Occasionally')
[Verb Dictionary Form / Nai-form] + ことがある (Indicates non-habitual, occasional occurrences)
'[Verb Dictionary Form / Nai-form] + ことがある' indicates that an action or situation occurs occasionally or from time to time. While it is not a daily habit, the situation does happen at a low frequency. It is frequently accompanied by frequency adverbs such as 'たまに' (occasionally) or '時々' (sometimes). Using the negative 'ない形 + ことがある' means 'there are times when one does not...'.
⚠ Note: Key Exam Trap: Do not confuse '辞書形 + ことがある' (occasional occurrence: 'sometimes happens') with N4 'た形 + ことがある' (past experiential: 'have had the experience of'). Exam questions often hinge on frequency adverbs like 'たまに' or '時々' to test whether you recognize the present occasional pattern.
私は健康のために自転車で通勤していますが、雨の日はバスで行くことがあります。
I commute by bicycle for my health, but on rainy days I sometimes take the bus.
父は忙しいとき、晩ご飯を食べないことがある。
When my father is busy, there are times when he does not eat dinner.