<APIError> code=-5041, msg=Time out for too many requests from this account queueing at the same time

Getting very strange behavior when placing orders through portfolio margin account.

I was trying to place 3 pairs of orders (6 total). 2 Pairs were getting this error as shown in the title. However, for the 2 pairs that got the error, 1 pair of orders actually got filled. This inconsistent behavior is frightening.

A related issue is the error or success response delay was like 2 seconds. That is crazily high for trading.

Any idea we could improve on this? Does it have websocket support for placing portfolio margin orders?