Trying some filter code against past changes (known as RC, recent changes), when it is a page creation, page_id equals the current page id, which is faulty. When the filter had been executed "for real", the page_id was 0, as the page had not been created yet.
See the documentation about the page_id variable:
In theory this is 0 for new pages, but this is unreliable. If you need an exact result, use "page_age == 0" to identify new page creation. (note that it is slower, though.)
See also this discussion with the user who had spotted the issue.