You need to copy self.g in order to really keep PSBT_GLOBAL_UNSIGNED_TX. This code will wipe the whole map since old_g is just a reference to self.g.
diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py
index 1fe3b21542..131ffe85e0 100755
--- a/test/functional/rpc_psbt.py
+++ b/test/functional/rpc_psbt.py
@@ -790,6 +790,8 @@ class PSBTTest(BitcoinTestFramework):
assert_greater_than(len(parsed_psbt.o[vout].map[PSBT_OUT_TAP_TREE]), 0)
assert "taproot_tree" in self.nodes[0].decodepsbt(psbt)["outputs"][vout]
parsed_psbt.make_blank()
+ # make_blank shouldn't have removed PSBT_GLOBAL_UNSIGNED_TX, but it has.
+ assert parsed_psbt.g == PSBTMap()
comb_psbt = self.nodes[0].combinepsbt([psbt, parsed_psbt.to_base64()])
assert_equal(comb_psbt, psbt)
diff --git a/test/functional/test_framework/psbt.py b/test/functional/test_framework/psbt.py
index 6bb899be53..6fb81ba4cf 100644
--- a/test/functional/test_framework/psbt.py
+++ b/test/functional/test_framework/psbt.py
@@ -132,6 +132,7 @@ class PSBT:
old_g = self.g
self.g = PSBTMap()
+ assert old_g == self.g == PSBTMap()
self.g.map[0] = old_g.map[0]
def to_base64(self):