INVALID_TO issue when swapping tokens to be delivered to a smart contract

Using the uniswap router contract swapExactTokensForTokensSupportingfeesOnTransfer to swap from the contract token to USDT.

A liquidity pool (and therefore an LP pair) exists for the token-USDT pair therefore I’m using the path address(this), USDT address. If I set the “to” to be address(this) I get an INVALID_TO error response, if I set it to another address the function works as expected. I can see in the pair.swap function in the uniswap contracts that this error is called when you’re trying to send to one of the parts of the pair, however this doesn’t get returned when you do the same with a WETH pair, using swapExactTokensForEthSupportingFeeOnTransferTokens, which calls the same swap function.

Why is this and is there any way round it other than to deliver the funds to a separate address and deal with them from there?

Maybe you can just ask the developer of the Uniswap, I think they can give you an answer quickly.

And could you please share the failed transaction hash?

Re-read the uniswap functions a bit more carefully. SwapTokensForTokens functions have a different path to swapping for Eth, which is why when doing the same swap with Eth I don't get the error.

Still unsure why you're not allowed to send the results of a swap to one of the tokens in the pair contract: I just got around it using a child contract to manage the swaps.