WikiPage::getRedirectTarget() / WikiPage::insertRedirect() contains logic to detect two incomplete database migrations – introduction of the "redirect" table (2008) and addition of rd_interwiki and rd_fragment fields to that table (2011) – and insert/update the redirect table rows if they weren't migrated.
These migrations seem to have been completed in Wikimedia production, probably many years ago, either thanks to this code or some manual maintenance. We should remove this fallback.
There are a few outdated entries in production that can't be updated – either due to using syntax for redirects that is no longer accepted (in which case it has nothing to update), or due to database corruption (in which case it throws errors, e.g. T281223). I'll list them, then fix the former and file/find bugs about the latter.
(I found this while investigating T346383)