PSBT (BIP-174, Partially Signed Bitcoin Transaction) Ordering of keys
There is no mandatory ordering. If you assume your parser is correct, then it is fine to compare the objects themselves. However, to be sure everything is correct, I would suggest that you compare the serialized PSBTs themselves.