This allows the reindex flag to be set to auto, which automatically starts a reindex if the chain state or block index are corrupt. This can be especially useful for Raspberry Pi based full nodes, which often experience power outages or similar issues which can corrupt data.
It allows full node operators to make Bitcoin Core reindex automatically, without having to worry about removing the reindex flag again. (Which isn’t much effort, but can be annoying to forget).
In case this error message is printed, pretty much nothing else except a reindex can be done, so adding this feature would make user experience slightly better.
Rebased version of #22072.