This occurs because you do not have enough funds to place even the minimum allowed order. For example for a BTC/USD market, if you see an invalid range in margin, it means in the ‘buy’ case that you do not have enough USD and in the ‘sell’ case enough BTC to place the minimum order possible.
Note that some bots require you to have a little more than the minimum in order to overcome trading fees and continue trading. That means that it is possible to have enough funds to place a manual trade but not start a bot in some cases.