Problem
Legacy wallet migration uses the read-only BDB parser to verify that every page LSN is reset before reading records without BDB log files.
The BDB last_page metadata field stores the last valid page number, but the parser treated it like a page count and scanned only 0..<last_page:
https://github.com/bitcoin/bitcoin/blob/e2b0984f99519f76423ce26ce9077ca765b2b30b/src/wallet/migrate.cpp#L87
This skipped the final page, so a database whose last page still depended on BDB logs could be accepted.
Fix
Scan LSNs through last_page inclusively.