Yes you have overpaid your mortgage but you might have made more with that money elsewhere.
Here's an example. My mortgage is 0.99% for £500k. It's interest only so I pay £4,950 a year in interest. Say I have £50k which I could invest or overpay on my mortgage.
A) I overpay, I now pay 0.99% on £450k so I pay annual interest of £4,455. I've saved £495 in interest
B) I put that £50k in a fixed rate interest savings account. According to MSE, the leading one year fix is 4.5%. So I pay £4,950 interest on my £500k mortgage and receive £2,250 in interest on my £50k savings, so a net payment of £2,700. I'm £1,755 better off than under option A. And that money is still there to overpay in the future if I wish (for example, if mortgage rates rise, subject to the annual limits).
C) I put that £50k in a stocks and shares ISA. I generally make 20-30% a year but being conservative, the average return from the FTSE 100 is 9% a year since 1985. So I make 9% on my £50k which is £4,500. I pay £4,950 in interest and receive £4,500, so a net payment of £450. I'm over £4k better off than option A.
Appreciate the risk isn't for everyone and stock markets can fall (as many did in 2022) so should be over at least five years. And not everyone is on a 0.99% mortgage and interest rates have gone up a lot over the last year.
But extrapolate that over 10 years and you could have sacrificed quite a large sum of money. Rant over other than advising that people should at least look at mortgage v savings interest rates before deciding to overpay on a mortgage.
(Disclaimer I'm laid up after surgery doing the calculations on my phone so excuse any errors)