Working on pancakeswap clone - getting Invalid Signature Error whenever attempts to withdraw liquidity from normal trading pools

I've been able to get factory, init hash and router set up fine on bsc testnet and have created trading pairs with testnet tokens, deposited liquidity and made swaps.

But every time I try to withdraw liquidity I'm getting "estimateGas failed removeLiquidityETHWithPermit" errors, which also mention "data: {code: 3, message: "execution reverted: Pancake: INVALID_SIGNATURE".

I believe it's related to these similar issues:

I'm running the code locally and am not sure what would be needed to get the correct signatures to allow for withdrawals.

Has anyone experienced this or can shed any kind of light on it at all because I'm truly stumped right now.

Have you solved the issue? I'm facing the exact same problem.

hello i'm also stuck here.. have you solved this?

Guys,

The answer present in here solved the issue for me. Please check.