The problem of calculating the transaction confirmation time mainly consists in the inconsistency of the period of the release of new blocks. If the blocks came out exactly every 10 minutes (even with an error of 1-2 minutes), then it would be possible to relatively accurately estimate the time after which the transaction would have 1 confirmation. In reality, Bitcoin blocks can come out with a period of 1 minute to 2 hours and the number of new transactions during this period can arrive more, which will greatly increase the load on the network.
Even when sending a transaction with a high fee, no one can be sure that in 10-20 minutes this fee will not cease to be relevant. Anyone can fall into this situation: both the sender and the recipient. Using Bitcoin, you need to understand how the network works and accept the rules of its operation.
If you sent a transaction and it still has not been confirmed, most likely it is in the "queue" — the Bitcoin mempool and expects the miners to include it in the block. The position in the mempool depends on what fee (fee per byte) you sent your transaction to — the higher the commission, the faster your transaction will go.
To predict how long your transaction will be confirmed, go to the site of the explorer blockchair.com, enter the transaction identifier (TXID, hash). Let's give an example, for a transaction with hash: b7f1813807462650e521b8d98a5da4fee9cfb80347cfefad96172e9f4ec64275
So, we carry out the calculation: The number 1676 (the priority of our transaction in the Bitcoin mempool) is less than the number 2500 (the total number of transactions in the Bitcoin block), this means that our transaction will take place in the next block, or in 10 minutes.
In practice, the priority of a transaction is constantly changing, because more and more new transactions appear on the network. And since no one can predict the time of the release of a new block, it is simply impossible to calculate the exact time of transaction confirmation.