False qty exception thrown when placing order

Getting this error with stocks sometimes and cryptos consistently. Even though the position info shows qty as available, it is unable to place a sell order to close.

Unable to place take profit order for BCHUSD because {“code”:40010001,“message”:“qty or notional is required”}
{ ‘asset_class’: <AssetClass.CRYPTO: ‘crypto’>,
‘asset_id’: UUID(‘4d752b8a-3245-45ca-a407-336c6baca7e6’),
‘asset_marginable’: False,
‘avg_entry_price’: ‘441.58’,
‘avg_entry_swap_rate’: None,
‘change_today’: ‘0.0045827829782347’,
‘cost_basis’: ‘9.974774’,
‘current_price’: ‘437.32’,
‘exchange’: <AssetExchange.CRYPTO: ‘CRYPTO’>,
‘lastday_price’: ‘435.325’,
‘market_value’: ‘9.878545’,
‘qty’: ‘0.022588826’,
‘qty_available’: ‘0.022588826’,
‘side’: <PositionSide.LONG: ‘long’>,
‘swap_rate’: None,
‘symbol’: ‘BCHUSD’,
‘unrealized_intraday_pl’: ‘-0.096229’,
‘unrealized_intraday_plpc’: ‘-0.0096472361178308’,
‘unrealized_pl’: ‘-0.096229’,
‘unrealized_plpc’: ‘-0.0096472361178308’,
‘usd’: None}

Unable to place take profit order for UNIUSD because {“code”:40010001,“message”:“qty or notional is required”}
{ ‘asset_class’: <AssetClass.CRYPTO: ‘crypto’>,
‘asset_id’: UUID(‘24cc8b92-9c7a-41d6-96c0-20c2e9f85c18’),
‘asset_marginable’: False,
‘avg_entry_price’: ‘12.542781152’,
‘avg_entry_swap_rate’: None,
‘change_today’: ‘-0.0104864779626271’,
‘cost_basis’: ‘19.94713’,
‘current_price’: ‘12.55’,
‘exchange’: <AssetExchange.CRYPTO: ‘CRYPTO’>,
‘lastday_price’: ‘12.683’,
‘market_value’: ‘19.95861’,
‘qty’: ‘1.590327478’,
‘qty_available’: ‘1.590327478’,
‘side’: <PositionSide.LONG: ‘long’>,
‘swap_rate’: None,
‘symbol’: ‘UNIUSD’,
‘unrealized_intraday_pl’: ‘0.01148’,
‘unrealized_intraday_plpc’: ‘0.0005755213907966’,
‘unrealized_pl’: ‘0.01148’,
‘unrealized_plpc’: ‘0.0005755213907966’,
‘usd’: None}

The order qty is set directly by calling position.qty_available for the given symbol