Bracket Order Error for Shorting

Could I get some help setting up a SELL bracket order for shorting? What is the proper syntax? I’ve tried the code below from examples on alpaca but its not working for shorting.

       market_order_data = MarketOrderRequest(
                    symbol="NVDA",
                    qty=teslashares,
                    side=OrderSide.SELL,
                    time_in_force=TimeInForce.DAY,
                    order_class=OrderClass.BRACKET,
                    take_profit=TakeProfitRequest(limit_price=prof),
                    stop_loss=StopLossRequest(stop_price=loss)
                    )
            # Market order
        market_order = trading_client.submit_order(
            order_data=market_order_data
           )