Creating short and long orders at the same time

According to Alpaca’s documentation, it does not support going instantaneously from long position to short position. My question is, what happens when one attempts to place a limit order to buy X shares and then another limit order to sell X shares, assuming they start with no shares and the traded asset is shortable.

Thanks for the help in advance!