and make callable higher up with (nRet == 0) check.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19133 | core#19133]] [5/10]
https://github.com/bitcoin/bitcoin/pull/19133/commits/ff41a3690066081772b172f3c31a63f5fe6ea7ed
Depends on D9944