The refund form coded in T421277 works for synchronously executed refunds but fails when they are executed under coworker via JSON rpc.
For Adyen: Configuration key 'accounts//ws-api-key' does not exist.
For PayPal: POST request to https://api.paypal.com/nvp failed 7 times.
For Gravy: Key cannot be empty
Seems it's somehow not loading the SmashPig context correctly, but it's hard to understand how.
https://phabricator.wikimedia.org/T405053 has advice for running coworker with debug. (but that involves running via wmf-cv not jsonrpc)