Problem: CheckBlockDataAvailability checks whether the upper block has any requested bit. GetFirstBlock requires every requested bit, so a partial match can reach its assertion. At genesis, the existing undo exception can reject an undo-only request or accept a request with missing block data. It also misses ranges containing only genesis.
Fix: Require every requested bit on each block in the range, except that genesis needs no undo data. An empty mask now succeeds for a valid range because it requests no bits. Both index-startup calls supply nonempty masks.