I know this is an old issue, however somehow I'm running into this issue also on a local installation.
How it came to light, localy has_parent selector gave empty results, which should'nt have happend. Testing showed that has_parent only would give direct parent page as result.
When I took a look at the pages_parents table it shows only 6 entries. However the original database import had 343800 entries.
So I wonder what is / could be causing these entries to disapear. How and if it can it be rebuild. And is there a relation between has_parent selector and the table pages_parents?
The instance of ProcessWire is running PW 3.0.200 with PHP 7.4.33