Even with matching IDs and mods, BattleEye can still reject your HC. By default, BattleEye treats every connection as a potential threat. You need to explicitly tell the server: "This is not a player. This is a friend. Let it cook."
The server must explicitly allow connections from the IP address where the Headless Client is running. server.cfg
If you are reading this, you have likely spent the last hour staring at your Arma 3 server console, watching the Headless Client (HC) connect, immediately disconnect, and vomit a red error message: