joinpsbts collects the global xpubs of all the joined PSBTs into merged_psbt, but returns a separately constructed shuffled_psbt into which only the inputs, outputs, and unknown fields are copied. The collected PSBT_GLOBAL_XPUB records are silently dropped, and PSBT_GLOBAL_PROPRIETARY records are not collected at all.
The xpub collection was added in #17034, which was written against a joinpsbts that still returned merged_psbt, but was merged after #16512 had introduced the shuffled_psbt rebuild, so the collected xpubs have never reached the result.
Shuffle the inputs and outputs of merged_psbt in place instead of rebuilding a new PSBT, so that all global data is preserved, and union the global proprietary records in the merge loop, matching the combinepsbt behavior from #34893.