I think you're saying sometimes the match is not highlighted according to the 'hlsearch' option. From the help for that option:
When the search pattern can match an end-of-line, Vim will try to
highlight all of the matched text. However, this depends on where the
search starts. This will be the first line in the window or the first
line below a closed fold. A match in a previous line which is not
drawn may not continue in a newly drawn line.
In other words, you probably are not seeing a match that starts before the lines which are currently displayed on-screen. Does that match what you're seeing?