Math guy here.
You've confused yourself with that complicated formula, because it is a derivation of the central formula, and the derivation requires certain assumptions to be made.
The core formula is that for each interest calculation period, the added interest in that period is (interest rate / # of periods per year +1) * remaining principal. We add the interest, subtract the payment that was made, and that is the new principal. Then we repeat for each period.
This is the operating principle of all loans. The period is monthly, daily, or whatever suits the lender.
But then, people want loans which definitely end at a particular date. This is purely an artifice: the above formula doesn't care when the loan ends. You can do this in Excel easily enough: just make a spreadsheet with 360 lines in it (30 years x 12 months). And then you could sit there trying numbers over and over until you find the monthly payment that results in the principal being zero on the month you want to be the last.
However, thanks to calculus, you can take the original formula and deriveone that will spit out the right payment for any given amount, term in years, and payments per year. That's exactly the formula you quote in your question. That's not the absolute truth of interest calculation; it's just a derivation based on those assumptions.
So you are changing the assumptions, which breaks the formula you quoted.
So you need to go back and look at the contract. People are emotionally attached to the idea of the loan hitting zero on the last month, so lenders might do a little fudging, and treat a payment that arrived on the 27th or the 3rd as if it arrived on the 1st. Otherwise, the slightly changed interest will throw the payment schedule off. So you need to read your contract and see how they actually do that.
If they are compounding daily or continuously, you can simply reapply your formula with (days/14) number of payment periods over the loan duration. "14 days" does not go evenly into 365.24 days per year, so saying 26 periods per year will not give a correct answer.
If they are compounding monthly, then you need to model that: on 2 months per most years (and 3 months in a few years), your payment will be 150% of the normal payment. And the formula you put in your question is absolutely not designed to calculate that!
All this to say, when you do weird and complicated stuff with loads, the "standard" payment formula goes out the window, and you must find an alternate way, such as that 360-row Excel spreadsheet.