WikiPageEntityRevisionLookup::getLatestRevisionId() should throw an UnsersolvedRedirectException when encountering a redirect.
It currently just returns false in this case. That leads to RevisionBasedEntityLookup::hasEntity to return false in this case, making it impossible to distinguish between a redirect and a non-existing entity. That in turn leads to RedirectResolvingEntityLookup violating its contract for hasEntity, which states that "If the given entity ID points to a redirect, that redirect is resolved and the existence of the target entity is checked."
Throwing an UnsersolvedRedirectException from getLatestRevisionId if $row->page_is_redirect is true would fix all this. We should however double-check that nothing relies on hasEntity returning false for redirects.