Towards the expiry or closing time time of each trade, there is a no-trading window.
This typically occurs in the few minutes before the option closes, in which no new trades can be placed or existing options closed.
This no trading time varies for different asset types:
Forex: 2 minutes
Commodities: 2 minutes
Stock Indices: 5 minutes
Cryptocurrencies: 5 minutes