This fixes the test_framework.authproxy.JSONRPCException: non-final (-26) error when node 1 is one block behind of node 0. (height 122 vs 123)
This is a backport of core#19122
Only one of the two commits is needed for us:
https://github.com/bitcoin/bitcoin/pull/19122/commits/fa7d3a88900a800c9eca81b238337d07825a3320