It's happened to me at IB. I've had index option spreads and the futures were between strikes - which would leave me short/long the futures after expiry. I've waited til the last hour and had them get auto liquidated in some cases. It's never happened to me before 3:25pm and generally it happens between 3:25 and 3:45pm. I try to have my positions closed out by 3:15 or so. There's no warning and deeper in the money positions may get taken much sooner. The other issue is that once the computer selects something to close, the closing of that position may not fully bring the post expiry margin into compliance, so it closes another position...and perhaps another - very quickly. Depending on the precise timing you can get a horrible fill. I've only been auto liquidated during unforeseen circumstances or I've missed/forgotten something and I understand the broker has to protect themselves - and me. I don't love it, but I understand.
I have had ITM positions expire with delivery of stock which exceeded my capital in the account at TD. It appears that the broker doesnt assess the risk of options being exercised other than the risk assessed when allowing you to put the option trade on itself. Once I received the stock overnight, it was clear that either more money would need to be deposited or the stock would need to be sold. TD is not as advanced as IB and a conversation over the phone was an agreement that I would do the liquidation in after-hours trading to avoid overnight risk and get a better price than some computer doing market orders. The caveat here is that if the market is crashing during the night like on election eve, the broker has the right to sell your stock (not exercise your ITM options before 5PM) when it's at the lows to avoid the broker gettting stuck with your stock. Then your losses are 100x more than the nickel you made on the day of expiration. "Widow Maker".