It usually happens when there are too many decimal places in the number of tokens. When there are too many decimal places in the number of tokens, the “cannot estimate gas” error may occur. For example, if you’re swapping BNB for 1654563850.9683254256 StackBTC, you may get the error message. This is because the token has too many decimal places.
To fix this, first try to increase your slippage. If this doesn’t work, change the last numbers of the token that you’re trying to buy to zeroes. For example, if you’re trying to buy 1654563850.9683254256 StackBTC, change it to 1650000000. In most cases, this will fix the “cannot estimate gas” error.