The network byte order bit in de PDU header from a subagent request is not used in the response of the master agent.
I replaced
AgentXPdu* response = new AgentXPdu();
with
AgentXPdu* response = new AgentXPdu(req.network_byte_order, AGENTX_RESPONSE_PDU);
in
“AgentXPdu* MasterAgentXMib::create_response”.