This bug doesn’t have any effects currently because it only affects external signer RPCs which aren’t currently using the wallet context, but it does cause an appveyor failure in a upcoming PR:
https://ci.appveyor.com/project/DrahtBot/bitcoin/builds/38512882
This bug is subtle and could have been avoided if JSONRPCRequest didn’t have constructors that were so loose with type checking. Suggested change #21366 (comment) eliminates these and would be a good followup for a future PR.
This PR just implements the simplest possible fix.