Gas estimation dues to error in contract

I am trying to make transaction through metamask on polygon chain and its giving me an error in contract.
But this is not a constant error it occurs only sometimes…can anyone help me on this

Hello, if you are using the metamask plug-in version, please close other DAPP pages when using the swap function. In addition, the transaction of matic chain sometimes has some delays. You need to stay on the gas calculation page for a few seconds, and then you can see the normal gas