AnalyzePSBT computes fee = in_amt - out_amt once every input amount is known and returns it as is. A PSBT whose outputs are worth more than its inputs therefore gets a negative fee and a next role of updater, even though no wallet can ever sign it into a valid transaction. The function already returns PSBT is not valid. ... for bad input values, unspendable outputs and an out-of-range output total.
An output total above the input total is reported the same way:
before: {"fee": -1.00000000, "next": "updater", ...}
after: {"next": "creator", "error": "PSBT is not valid. Output amount larger than input amount"}
The functional test builds a PSBT that spends a 1 BTC output into a 2 BTC output and checks the error and the creator role. Without the change the assertion on next fails. rpc_psbt.py, wallet_send.py, wallet_multisig_descriptor_psbt.py, rpc_openrpc.py and the psbt unit tests pass.