verify_compare_page_id_lists takes two lists of pages, and compares them for equality. The idea is that if we get one set from the btree and another set from a third party (e.g. PALI) we can find any discrepancies.
If it finds a mismatch, the function returns EINVAL, which is not appropriate for this use case – this return value generally indicates a mistake the caller made by supplying an invalid argument, e.g. errno -l on my system says it's for "Invalid argument". This leads to Python tests failing with incorrect error messages like _wiredtiger.WiredTigerError: Invalid argument.
Something more appropriate might be WT_ERROR with a sub-error code specific to verify, or maybe even something specific to the page list comparison.