In a JSON-RPC batch, an element that is not an object gets an error reply with the id and version of the element before it.
ExecuteHTTPRPC uses one request object for the whole batch. parse() throws on a non-object before it resets id and m_json_version. For [{"jsonrpc":"2.0","method":"getblockcount","id":"X"}, 2] the reply has two objects with "id":"X", one with a result and one with an error. If the first element is a notification, the error is dropped. I reset both fields at the top of parse(), so the error is the one the first element of a batch already gets. The new case in interface_rpc.py fails on master and passes with this change.
This is one of several PRs from a large audit of Bitcoin Core that I did with the help of LLM tools. The audit produced its evidence all at once, which is why the PRs arrive together. I understand each change fully and will answer review questions myself.