web3.eth.estimateGas is always calculating low gas for the transaction. Here is a reference to a trasaction in ropsten. https://ropsten.etherscan.io/tx/0xd5bead5b576b2f4e4cbe83e4acf20d701740b05fdaf3f2749e0c1973ea4c7d6c
I used the data feild and contract address to calculate the gas. I got => 21464. But it actaully required 47032. This is one example but I have the same problem for other transactions as well.
web3.eth.estimateGas({
to: "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe",
data: "0xc6888fa10000000000000000000000000000000000000000000000000000000000000003"
})
.then(console.log);