You're assuming banks use that formula and not just YOLO it, "haha fuck you pay me more".
Financial calculators do integrate, though. "Present value" is computed by integration.
On some things, governments put the cap on how much can early payments be loaded with interest and how much at least should be paying off the base debt — otherwise, you'd be paying only the interest for the first 15 years of a mortgage.
Though, these things work slightly differently in different countries.