Currently a few return values are undocumented. This is causing confusion at the least. See for example [[https://github.com/bitcoin/bitcoin/pull/18476 | core#18476]]
Fix this by treating it as an internal bug to return undocumented return values.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/20459 | core#20459]]
Depends on D12716