Subject: Re: Can't belive I did that
https://www.interactivebrokers...
The problem ends up being settlement time and that is why Interactive Brokers (and I assume the higher end prime brokerage relationships) offer solutions to this issue where they will sell you new T+0 (immediate settlement) shares out of their own market maker inventory in order to offer this service to customers. If you enable it ahead of time. And there isn't a dividend or other corporate action within 5 days on either side.
Alternatively - a good prime broker will let you just be short the stock from an exercised call despite also being separately long. You can cover that short whenever, with the customary tax treatment for covering the short with a loss or gain.
FWIW, Fidelity will also let you be short a stock and long a stock at the same time. They have their buy to open, sell to open, buy to close, sell to close buttons. I have accidentally created an offsetting but separate long position in an index ETF when I was trying to close a short position. They cleared it up after a phone call but it proves they allow offsetting positions.