Also, while nosing around in this, I tried to pprint(root) at the point of the error, and got
2023-10-26 12:48:37.852 EDT [1186007] WARNING: could not dump unrecognized node type: 37413808
I came across a similar warning when I tried to pprint(innerrel):
WARNING: could not dump unrecognized node type: 0
... even though we've made UniqueRelInfo be a Node type in commit 2b26a69455.
This happens because we use palloc to allocate UniqueRelInfo node in innerrel_is_unique_ext(), which I think should be replaced by makeNode. Attached is a trivial patch to do so.