Assets get locked while doing a market buy

I find this problem with some coins like AAVE, 1INCH
After I buy using a market order, when I try to sell using a market_sell it fails giving this error-
APIError(code=-2010): Account has insufficient balance for requested action.
And when I check my asset balance using the API I get this -
image
But I can sell it easily on the website.

Nevermind this was a dumb mistake of mine , actually I was placing take profit before selling and that take profit wasn’t executed