Slippage Fee Increasing but Same Fees

I’m using a heavily modified version of Safemoon that includes a fee based on certain conditions, on normal conditions the fees are set to 10% - on different conditions these fees become 20%.

On normal transactions this works fine - 10% fee so a 10% slippage is needed.
In the beginning the 20% fee worked as well (20% slippage), but for some unknown reason the minimum slippage increased from 20% to 30%, but in the transaction you can see that the fee was only 20%; the 30% slippage wasn’t needed.

How does Uniswap/Pancakeswap determine what the minimum slippage is? The transaction error occurs before I can even attempt a transfer.