Currently, the latest index state may not be committed to disk on shutdown.
The state is committed on ChainStateFlushed callbacks and the current init order unregisters the indexes as validation interfaces before the final ChainStateFlushed callback is called on them.
This was causing the txindexing progress to have fallen behind to its last random checkpoint the next time bitcoind was started.
This is a backport of Core PR17897