Solidity swap and add liquidity in contract

I don’t understand what the error is, when you execute the ZapInToken function with a pair of Cake/WBNB or Cake/USDT tokens, everything is completed successfully. If you take a pair with a commission of 5% (pancakeswap), it returns the error: “Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Returned error: {“jsonrpc”:“2.0”,“error”:“execution reverted”,“id”:2392006384191628}” Despite the fact that the contract has the SetFee function, and I set the required commission there.

ZapV2.sol

I tried to change the commission size using the SetFee function, approve everything was done, the number of tokens was also sufficient.

This error can occur if you are calling the contract function on the wrong chain or if the function which you are calling does not exist.