This commit has no effect right now, but hardens the code for the future
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19528 | core#19528]] [1/4]
https://github.com/bitcoin/bitcoin/pull/19528/commits/fa459bdc87bbb050ca1c8d469023a96ed798540e
Depends on D10010