This means that it is being called in two situations:
1.) As part of the invalidateblock rpc
2.) When we receive a block for which we have a valid
header in our block index, but the block turns out to be invalid
This is a partial backport of core#30666
https://github.com/bitcoin/bitcoin/pull/30666/commits/783cb7337f72a3c7b2e74efd677a8ff0c375fe10
Depends on D17999