Margin Shortfall for expired option

Ah, sorry. Missed that bit. There will be shortfall penalty, please check out this post: Margin Penalty applicable if all my short options expire tonight - #4 by MohammedFaisal

When you’re selecting exit all, you will be placing market order. Here execution depends on market factors, for some contracts, liquidity will be good, while there won’t be much for others, so the execution can vary.

Hence, when you’re squaring-off your position, best to first exit short leg and the the long.